Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 292501 - media-libs/libsvg: does not work in locales with a comma as decimal separato
Summary: media-libs/libsvg: does not work in locales with a comma as decimal separato
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Graphics Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-09 11:28 UTC by Guido Flohr
Modified: 2016-10-01 07:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
A grey triangle on white background (triangle.svg,346 bytes, image/svg+xml)
2009-11-09 11:30 UTC, Guido Flohr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Flohr 2009-11-09 11:28:34 UTC
Parsing point specifications only works when the decimal separator is a a decimal point.

Reproducible: Always

Steps to Reproduce:
Compile xsvg (depends on libsvg and libsvg-cairo) and make it locale aware.  That is, in xsvg-0.2.1/src/xsvg.c add a call to setlcale() in function main():

#include <locale.h>
int
main (int argc, char **argv)
{
    args_t args;
    win_t win;
    Display *dpy;

    setlocale (LC_ALL, "");

    args_parse (&args, argc, argv);
    /* etc. */

Now use xsvg to display the attached triangle.svg.
Actual Results:  
In the C locale the program works as expected.  In locales with a decimal comma, the parser misinterprets the file.  The problem lies at:

    <polygon fill="#aaaaaa" points="50,10 80,10 65,160"/>

Instead of three xy coordinates, the parser parses three floats here.


The function _svg_ascii_strtod() in libsvg-0.1.4/src/svg_ascii.c actually shows that the author was aware of the problem.  But the function obviously doesn't work at all, making the entire library completely useless for localized applications.  The only workaround for client programmers is to temporarily switch locale, but that is not thread-safe, leave alone inefficient.

While researching where to file the bug report upstream I found this link https://bugs.freedesktop.org/show_bug.cgi?id=14773 showing another bug in the suite.

Since libsvg and therefore libsvg-cairo and xsvg seem to be unmaintained upstream, I would opt for removing the ebuilds from Gentoo.  That will prevent people from building new applications around that unmaintained code base.
Comment 1 Guido Flohr 2009-11-09 11:30:43 UTC
Created attachment 209725 [details]
A grey triangle on white background

Parsed correctly by libsvg in the C locale, but not in de_DE.utf8, fr_FR.utf8, or any other locale where the decimal separator is a comma.
Comment 2 Pacho Ramos gentoo-dev 2016-10-01 07:28:46 UTC
removed