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 523349 - gcalctool does not work in some locales
gcalctool does not work in some locales
Status: RESOLVED DUPLICATE of bug 527669
Product: gnome-calculator
Classification: Core
Component: general
5.22.x
Other Linux
: Normal critical
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-19 12:06 UTC by Stanislav Brabec
Modified: 2008-04-12 08:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stanislav Brabec 2008-03-19 12:06:11 UTC
How to reproduce:

export LANG=cs_CZ.UTF-8
gcalctool

Then try to calculate:
430.5*3=
Current result: empty
Expected result: calculate

Additional information: gcalctool incorrectly interprets grouping information:

Examples:
430=
Current grouping: "4 30"
Expected grouping: "430"

1560.3
Current grouping: "156 0,3"
Expected grouping: "1 560,3"
Comment 1 Robert Ancell 2008-04-10 01:19:09 UTC
Hi Stanislav,

I can confirm the last problem (1560.3) but I cannot reproduce the first two.
Comment 2 Stanislav Brabec 2008-04-10 10:22:44 UTC
I can confirm all of them in openSUSE 11.0 alpha3 x86_64 with gcalctool-5.22.0.

Version 5.22.1 crashes (*** buffer overflow detected ***: gcalctool terminated) whenever I type any number, so I cannot verify it there.
Comment 3 Stanislav Brabec 2008-04-10 11:10:07 UTC
Sorry, way to reproduce problem 2 changed:

Press: 430.
Current grouping: "4 30"
Expected grouping: "430"
Comment 4 Stanislav Brabec 2008-04-10 14:28:27 UTC
I have fixed 5.22.1 crash in bug 527318 and I am able to reproduce all three problems in 5.22.1. Behavior changed again in worse direction:

430.5*3=
Current result: empty
(gcalctool:23286): Gtk-CRITICAL **: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed
Expected result: calculate, no critical warning

430.
Current grouping: "4 30"
Expected grouping: "430"

1560.3
Current grouping: "156 0,3"
Expected grouping: "1 560,3"

1560.3=
Current result: empty
(gcalctool:23286): Gtk-CRITICAL **: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed
Expected result: display entered value, no critical warning
Comment 5 Stanislav Brabec 2008-04-11 15:11:20 UTC
These problems were found in localize_number():

- Input string *src contains locale-specific decimal point ',', the code checks only for '.' as a decimal separator. (This is the problem causing the grouping bug.)

- Code hardcodes grouping by 3 instead of use of nl_langinfo->grouping
Comment 6 Robert Ancell 2008-04-12 08:07:03 UTC
I've merged all the thousands separator bugs into bug 527669 with a recent patch that appears to have fixed most of these problems. Thanks if you took the time to make a patch, I reviewed them but unfortunately none of them fixed all the problems simultaneously. Please test the patch and raise any issues in the new bug. Thank you.

*** This bug has been marked as a duplicate of 527669 ***