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 126640 - g_ascii_strtod not handling Persian decimal separator properly
g_ascii_strtod not handling Persian decimal separator properly
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.2.x
Other Linux
: Immediate normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2003-11-10 18:13 UTC by Roozbeh Pournader
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix the problem, against glib 2.2.3 (415 bytes, patch)
2003-11-10 18:18 UTC, Roozbeh Pournader
none Details | Review
patch to test the patch above (1.46 KB, patch)
2003-11-25 12:50 UTC, Behdad Esfahbod
none Details | Review
Final patch for both the bugfix and the test (1.68 KB, patch)
2003-11-25 15:21 UTC, Roozbeh Pournader
none Details | Review

Description Roozbeh Pournader 2003-11-10 18:13:59 UTC
g_ascii_strtod is not handling Persian decimal separator properly. It has a
problem if a decimal separator is more than one byte when encoded in UTF-8.

See <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=109568> for
details and a patch. The patch itself is at
<https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=95872&action=view>.
Comment 1 Roozbeh Pournader 2003-11-10 18:18:14 UTC
Created attachment 21342 [details] [review]
Patch to fix the problem, against glib 2.2.3
Comment 2 Owen Taylor 2003-11-13 12:33:18 UTC
Alex, could you look at this?
Comment 3 Roozbeh Pournader 2003-11-17 14:43:21 UTC
Changing priority to "Immediate", since "This bug blocks development
or testing work and should be fixed ASAP".

It blocks testing the Persian translation of GNOME.
Comment 4 Alexander Larsson 2003-11-17 16:10:12 UTC
This bugfix does seem right. However it would also be nice if the test
in tests/strtod-test.c (which actually tests fa_IR!) could be extended
to catch this case.
Comment 5 Behdad Esfahbod 2003-11-25 12:50:56 UTC
Created attachment 21792 [details] [review]
patch to test the patch above
Comment 6 Behdad Esfahbod 2003-11-25 12:55:15 UTC
Attached a patch for strtod-test.c.  Actually it's not quite easy to
test the bug, as the erronous if statement, in an ideal world, would
always evaluate to true.  So it's hard to put both tests for true and
false cases, and hope that one fails.  Then comes this bug in the if
condition.  Now we should try hard to make it evaluate to false.  As
it's a wrong pointer comparison, it can be done by shaping the malloc
memory, which the patch does.

Oops, patch has errors, Roozbeh, would fix another one?
Comment 7 Roozbeh Pournader 2003-11-25 15:21:39 UTC
Created attachment 21799 [details] [review]
Final patch for both the bugfix and the test
Comment 8 Roozbeh Pournader 2003-11-25 15:28:32 UTC
Last patch replaces both previous patches. It's what Alex approved to
be a correct patch for the bug, plus an extension to
tests/strtod-test.c that fails with current CVS head. May I apply?

Comment 9 Matthias Clasen 2003-11-25 15:34:17 UTC
Looks good to me.
Comment 10 Roozbeh Pournader 2003-11-26 14:03:20 UTC
Patch applied to HEAD and glib-2-2 branch. Behdad, would you test?
Comment 11 Roozbeh Pournader 2003-11-26 19:33:33 UTC
Tested by Behdad. Closing the bug as fixed.