After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 708408 - libxml2 outputs decimal numbers in a localized format
libxml2 outputs decimal numbers in a localized format
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xpath
git master
Other Linux
: Normal normal
: ---
Assigned To: Nick Wellnhofer
Depends on:
Blocks:
 
 
Reported: 2013-09-19 19:53 UTC by Gergely POLONKAI
Modified: 2021-07-05 13:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gergely POLONKAI 2013-09-19 19:53:37 UTC
Using libexslt (math extension) and libxml2, the results of transformation functions (e.g. math:sin()) return the number in a localized format (e.g. 56,23 for the hu_HU.UTF-8 locale) instead of POSIX (56.23).

I use libxml2 2.9.1 and libxslt 1.1.28, both shipped with Fedora 19 ATM.
Comment 1 Daniel Veillard 2013-09-30 02:27:33 UTC
Weird, can you attach a reproducing stylesheet. i checked EXSLT math code
and it doesn't do formatting on its own so it's something related to
libxml2 XPath, and i though it wasn't locale sensitive, well I tried
hard to avoid locale setting impact, maybe that was broken by mistake.

Daniel
Comment 2 Christian Persch 2013-09-30 08:52:39 UTC
As far as I can tell, the problem is in libxml2/xpath.c:xmlXPathFormatNumber() where it uses snprintf with %e or %f format, which will produce the locale dependent output.  There is code in glib (g_ascii_formatd) for this that could be adapted here.
Comment 3 André Klapper 2021-06-18 16:03:42 UTC
Closing this bug report as no further information has been provided. Please feel free to report this at https://gitlab.gnome.org if you can provide the information that was asked for in a previous comment and if this still happens in a recent and supported version. Thanks!
Comment 4 Nick Wellnhofer 2021-06-18 16:55:44 UTC
As explained in comment 2, this happens when switching to a non-English locale. This could be fixed by temporarily switching to the C locale with uselocale before calling snprintf.
Comment 5 GNOME Infrastructure Team 2021-07-05 13:25:43 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxml2/-/issues/

Thank you for your understanding and your help.