Gnome2 UTF-8 handling
Scott Oonk
s.oonk at comcast.net
Mon Nov 24 19:38:44 CST 2003
Hello,
I offered to help with the gnome2 port and David Hampton suggested I
look at making gnucash work better with utf-8. Not really knowing
anything about utf-8, I did a bit of googling, and now need some of
guidance on how to proceed.
From what I can see, GNUCash currently takes input from the user in
whatever character set they are using, converts it to a "wide character
set" (GdkWChar) for internal calculations, then converts back to the
users character set for output.
However, the Gtk2/Gnome2 widgets are now all designed to work on utf-8
strings. Which means any input we receive from these widgets is already
converted from the users character set to utf-8 for us. Any place we
accept input from the user we need to treat the input as utf-8 instead
of whatever character set the user is using. Likewise, any output we
send, we need to pass as a utf-8 encoded string and the Gtk2 widgets
translate back to the users character set.
I see two ways of going about this:
1.) Continue using the "wide character set" internally, and just
convert the user input from utf-8 to wide characters.
2.) Get rid of the "wide character set" and use utf-8 for the user I/O
as well as the internal calculations.
In my opinion, option 2 seems to be a cleaner solution, though it would
be a bit more work.
According to David, the main places this impacts is the register gui
code and the reading/writing of the xml data file. I poked around the
register code a bit and have a fair idea of the work needed to be done
there, but I don't really know which of the two options would be best.
Thanks,
Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20031125/f815464d/attachment.pgp
More information about the gnucash-devel
mailing list