GNOME Bugzilla – Bug 523349
gcalctool does not work in some locales
Last modified: 2008-04-12 08:07:03 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"
Hi Stanislav, I can confirm the last problem (1560.3) but I cannot reproduce the first two.
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.
Sorry, way to reproduce problem 2 changed: Press: 430. Current grouping: "4 30" Expected grouping: "430"
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
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
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 ***