Bug 693843 - libgs/gsapi fails to render some files when on a locale that uses , instead of . as separator
Summary: libgs/gsapi fails to render some files when on a locale that uses , instead o...
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: 9.07
Hardware: PC Linux
: P4 normal
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-07 14:18 UTC by Albert Astals Cid
Modified: 2014-02-17 04:37 UTC (History)
7 users (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Astals Cid 2013-04-07 14:18:24 UTC
Discussed with you guys a month ago on IRC about it but then lost time and seems this has gone unfixed yet.

If you are using libgs/gsapi and a locale enabled program some files fail to render in a locale that uses , instead of . as separator.

Example https://bugs.kde.org/attachment.cgi?id=77770

The suggested workaround was to use setlocale on what calls the libgs/gsapi functions but there is a concern that setlocale might interfere with the rest of threads of the same process.

So it would be good if this could be fixed at the gs level.

I volunteer to try to fix it if you point me to the part of the code that has the "broken" locale dependant parsing.
Comment 1 Chris Liddell (chrisl) 2013-04-08 07:39:21 UTC
Thanks for opening this.

FWIW, it hadn't been forgotten, we're just not agreed on the method to implement the fix.
Comment 2 Carlos Garcia Campos 2013-04-10 18:02:20 UTC
In libspectre we have this implementation of strtod that doesn't need to change the locale:

http://cgit.freedesktop.org/libspectre/tree/libspectre/spectre-utils.c#n267

It's based on g_ascii_strtod from glib see:

https://git.gnome.org/browse/glib/tree/glib/gstrfuncs.c#n690

Hope it helps
Comment 3 Chris Liddell (chrisl) 2013-05-07 08:21:25 UTC
Fixed in:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=e64ac4c8


I pulled in the "trio" sprintf/scanf "library" to give us a sprintf() over which we have control.
Comment 4 Marc MAURICE 2013-05-07 15:04:40 UTC
Hi,

Thanks for the fix.

Though the LANG=C workaround is easy for commandliners, is it possible to quickly have a fix release, so that it can make it to the distros packages?

For now, it's breaking all PS viewers (evince, okular), from Ubuntu to Archlinux.

https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1159931

Thanks in advance,
Marc
Comment 5 Chris Liddell (chrisl) 2013-05-07 15:21:38 UTC
Next release is scheduled for August, we won't be doing one earlier.

Distro's often pull changes in before official releases - despite our protestations.
Comment 6 Marc MAURICE 2013-05-07 15:51:43 UTC
My archlinux version is ghostscript 9.07
according to ghostscript.com this is the official release.

What do you suggest to maintainers then ? wait for the release in August ?
Apply the small commit patch ?
Comment 7 Chris Liddell (chrisl) 2013-05-07 16:02:36 UTC
(In reply to comment #6)
> 
> What do you suggest to maintainers then ? wait for the release in August ?
> Apply the small commit patch ?


Yes, either will work.