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 147717 - Character encoding saved data depends on the locale
Character encoding saved data depends on the locale
Status: VERIFIED DUPLICATE of bug 329202
Product: GnuCash
Classification: Other
Component: Register
1.8.x
Other Linux
: Normal major
: ---
Assigned To: David Hampton
David Hampton
Depends on:
Blocks:
 
 
Reported: 2004-07-16 13:38 UTC by Gabor Nagy
Modified: 2018-06-29 20:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gabor Nagy 2004-07-16 13:38:10 UTC
The same data are saved differently in the file if 
entered using different locales. The display is also 
bad. 
 
I set my locale like this: 
LANG=POSIX 
LC_CTYPE=en_US.UTF-8 
LC_NUMERIC="POSIX" 
LC_TIME="POSIX" 
LC_COLLATE="POSIX" 
LC_MONETARY="POSIX" 
LC_MESSAGES="POSIX" 
LC_PAPER="POSIX" 
LC_NAME="POSIX" 
LC_ADDRESS="POSIX" 
LC_TELEPHONE="POSIX" 
LC_MEASUREMENT="POSIX" 
LC_IDENTIFICATION="POSIX" 
LC_ALL= 
 
then start gnucash, type in a register description or memo field some 
accented characters, save the file. 
For example, I have entered "bevásárlás 95,85?" 
 
then I can unset LC_CTYPE (or set it to hu_HU.utf8, the same thing happens), 
start gnucash, the previous entry is displayed like this: "bev??s??rl??s 
(95,85â ?)". I enter the same text as above (except that I cannot type the 
Euro sign), save the file. 
 
This is in the file: 
  <trn:description>bev&#225;s&#225;rl&#225;s (95,85Eur)</trn:description> 
  <trn:splits> 
    <trn:split> 
      <split:id type="guid">6d89152f4b64c794d02a4fd7cdade468</split:id> 
      <split:memo>bev&#195;&#161;s&#195;&#161;rl&#195;&#161;s 
(95,85&#226;&#130;&#172;)</split:memo> 
 
The problem here is that I have entered the same text, and I expect to see the 
same text in the file regardless of my locale settings, which should only 
affect the display of this text on screen. 
 
Instead I have a file, with two strings and the two strings cannot be read 
at the same time. 
I think that instead of &#225; and &#195;&#161; gnucash should save &aacute; 
or it should stick to one codepage ex. converting everything to utf8.
Comment 1 Derek Atkins 2004-07-18 22:37:33 UTC
This isn't an XML issue, it's actually a gnome/register issue.
I've changed the component, because the SQL backend would fail in the same way.
Comment 2 Christian Stimming 2005-03-23 09:44:15 UTC
Actually I think this is quite well an XML or rather a backend issue, because
right now we don't have any notion of the "character encoding of the given
backend". The backend itself should store the information about which encoding
has been used for a given book. Right now that's not the case, which results in
precisely the reported error: The character encoding of the saved XML file
depends on the locale, because implicitly it is assumed that the book is encoded
in the current locale's encoding. Of course this will break down as soon as you
happen to change your locale. This needs to be fixed by adding a property
"character encoding" to the gnc-book.

The gnome/register issue is rather a question of correctly convert from the
backend's encoding to the gnucash internal encoding to the gnome display
encoding. But the original problem is orthogonal to the display encoding and
needs to be solved nevertheless.
Comment 3 Christian Stimming 2006-02-22 09:31:39 UTC
Note: Development on 1.8.x has stopped, so we won't fix anything there. However this issue *is* still a problem in the upgrading to 1.9.x/2.0, which is discussed in that other bugreport. In 1.9.x/2.0, this problem is already fixed.

*** This bug has been marked as a duplicate of 329202 ***
Comment 4 John Ralls 2018-06-29 20:45:21 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=147717. Please update any external references or bookmarks.