Protecting gnucash 1.8.x from utf8 locales

Didier Vidal didier-devel at 9online.fr
Mon Oct 17 14:48:38 EDT 2005


Le lun 17/10/2005 à 11:07, Christian Stimming a écrit :
> 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?
I haven't been aware of such discussion. Actually, until recently, the
idea was that there would be no more release of gnucash 1.8.
> 
> 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. 
Actually, this happened to me: I had no problem unless I used reports. I
believed that reports were broken and didn't use them :-). 
After I applied the patch, I had to modify some labels in my
transactions.

The worst case scenario is if the user has started to enter data in
utf-8, then adds more entries in ISO-8859-1. When the user will switch
to Gnucash G2, libxml2 will fail to convert a mixed file (it will still
read it, but fail to convert ISO-8859-1 to utf-8)

> 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.
That's probably why I didn't use them :-)

> 
> 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.
That's a difficult decision... One could argue that there is no big
problem for the moment (gnucash users don't complain), and there is a
risk to add this patch... On the other hand, non English-speaking people
that used gnucash with an utf8 locale (that's the case on fedora), may
think that gnucash is broken....

Didier.

> 
> 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