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 530532 - Support non-ASCII characters
Support non-ASCII characters
Status: RESOLVED DUPLICATE of bug 347630
Product: gnome-calculator
Classification: Core
Component: general
5.23.x
Other All
: Normal major
: 2.24.0
Assigned To: gcalctool maintainers
gcalctool maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-29 10:13 UTC by Robert Ancell
Modified: 2008-07-17 08:32 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24



Description Robert Ancell 2008-04-29 10:13:09 UTC
Gcalctool does not properly support unicode characters. The problems are:
- GTK+ uses locale dependant strings so users can enter any unicode character  (normally UTF-8)
- The thousands separators and radix can be non-ASCII
- The internal representation is ASCII (the code assumes string[3] will be the third character which is not correct if the input is UTF-8)
- The flex parser is 8 bit only and freaks out when it sees UTF-8 characters. It doesn't appear the standard upstream version of flex can support 32bit strings.

The proposal is:
- Use an internal unicode (32 bit strings) representation 
- Convert GTK+ input to unicode
- Convert equation to ASCII before sending to the parser. Obvious substitutions such as ×->*, ÷->/ need to be made before parsing.
- Consider doing localization at the latest possible point, i.e. before sending to the GUI for display.

The factors making this difficult currently:
- Lots of code modified v->expression in various ways
- Lots of code calls ui_set_display
Comment 1 Robert Ancell 2008-04-29 10:26:41 UTC
First patch to improve structure:
http://svn.gnome.org/viewvc/gcalctool?view=revision&revision=2086
Comment 2 Robert Ancell 2008-05-17 03:10:10 UTC
All display code now in display.[ch]:
http://svn.gnome.org/viewvc/gcalctool?view=revision&revision=2094
Comment 3 Robert Ancell 2008-07-17 08:32:09 UTC
Realised this is a duplicate of bug #347630

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