Protecting gnucash 1.8.x from utf8 locales

Christian Stimming stimming at tuhh.de
Mon Oct 17 05:07:34 EDT 2005


Dear Didier,

this patch is still pending, isn't it? Has there been any discussion 
whether this solution is a good one for the gnucash-1-8-branch?

In fact I have been implementing this patch manually ever since I 
switched to SuSE9.3, which has a UTF-8 locale by default. I.e. I added 
"export LANG=de_DE" to the gnucash script, and I recommended this to all 
the other Germany that complained about the utf8 chars. I'm not sure 
whether your concerns about the files from the utf-8 locales are really 
valid. I think that would only be the case if people started gnucash, 
saw the weird characters, but went ahead nevertheless and entered the 
new account names. However, I think that this wouldn't be the case -- 
people would first want to fix the weird characters, and that 
necessarily means they will switch the gnucash context to non-utf8. 
Also, if they use the account templates that are shipped with gnucash, 
then the account names are in latin1 anyway.

So becasue for gnucash-1.8.x we know for sure that the respective 
libgnomeui doesn't support UTF-8, I think this change is a usable 
solution and should be committed to the gnucash-1-8-branch.

Christian

Didier Vidal schrieb:
> [Resent, my first email bounced because I was not member of the list]
> 
> Some linux distribs (including Fedora) set UTF 8 locales by default.
> With such locales, GnuCash doesn't behave correctly. In particular,
> reports are not displayed correctly (utf8 chars are split in two).
> This patch transforms UTF_8 locales into their base locale at startup
> and displays a warning.
> It assumes locale naming schemes as described at
> http://www.linux.org/docs/ldp/howto/Unicode-HOWTO-3.html#ss3.4 and
> http://www.iana.org/assignments/character-sets
> 
> 
> Note:
> This patch is not transparent to gnucash users who already created files
> with an utf8 locale. Account names or transaction names they entered
> that had unicode letters are no longer displayed correctly. I'll try to
> work on a different patch that help display the html reports correctly
> also with in an utf8 locale, the only problem I've observed with
> gnucash/UTF-8 with fedora's package.
> By the way I also observed that gnucash does not write the encoding in
> the XML file that is saved. That might be the source of some
> locale-related problems, and definitely might be a problem for people
> that exchange gnucash files. 
> 
> Didier Vidal.
> 
> 
> ------------------------------------------------------------------------
> 
> --- gnucash-1.8.11/src/bin/generate-gnc-script	2003-01-23 07:30:21.000000000 +0100
> +++ gnucash-1.8.11.utf8protect/src/bin/generate-gnc-script	2005-09-05 00:00:00.255954108 +0200
> @@ -15,6 +15,8 @@
>  GUILE_WARN_DEPRECATED="no"
>  export GUILE_WARN_DEPRECATED
>  
> +(echo \$LANG | grep  UTF-8 > /dev/null ) &&  LANG=\`echo \$LANG | sed s/\.UTF-8//\` && echo UTF-8 not supported. Setting LANG to \$LANG
> +
>  exec "${TARGET_SCRIPT}" "\$@"
>  EOF
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gnucash-patches mailing list
> gnucash-patches at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-patches


More information about the gnucash-patches mailing list