UTF

Reinke Bonte reinke.bonte at web.de
Sat Sep 6 13:15:52 CDT 2003


Jon Lapham <lapham at extracta.com.br> wrote:
> > 1.) you have to change the encoding of your account files by doing
> > this strange procedure (if I remember correctly) because encoding of
> > the xml file is completely broken: 
> > recode XML..LATIN1 accounts
> > recode previous_encoding..UTF8 accounts
> > recode LATIN1..XML accounts
> 
> Can you give me the commands you run to do all this?

If you take a look above, you can see the commands assuming your
accounts file is called "accounts". Here they are again:

$ recode XML..LATIN1 accounts
$ recode previous_encoding..UTF8 accounts
$ recode LATIN1..XML accounts

If you type

$ info recode

you get some more detailed information.

The problem is that GNUcash gives strings in the local encoding to the
libxml library functions. As libxml finds out that they are not UTF-8 as
they should be, it somehow assumes they are latin1 characters and
translates them to xml entities. This usually works, because the
translation back works in the same strange way. But once you change your
encoding, you are in trouble, because gtk will stumble over hundreds of
illegal characters. This is what happens to you if you open your
ISO-8859-1 account file in a UTF-8 locale. The real problem is that all
the account tree templates are probably saved in ISO-8859-1 or something
similar, and when you try to open this in a UTF-8 locale lots of illegal
characters for all the accents and umlauts are fed into the gtk
functions, and they complain.

> > 2.) Then you have to force the font in the register window to use a
> > unicode charset (iso10646-1). I don't remember, but I think I
> > have put it by hand into the config-1.8.auto, because the preference
> > window wouldn't let me set the charset. And the default value is set
> > to Helvetica, which on my system doesn't even have a unicode
> > charset.
> 
> How do you do this?

This is only one thing. The step above is far more important.

As I said, I opened the the file ~/.gnucash/config-1.8.auto and
corrected the X font definition string. I'm not sure if this is the
best way of doing this. Maybe it is enough to just select a font with a
unicode charset for the register window.

Now that I think about this, as most people nowadays start gnucash from
a gnome2 platform, they have no access to the font control of gnome1
applications. As a workaround, I have a file .gtkrc in my home
directory, that just tells all gtk applications to use a unicode font.

> 
> > The above steps are necessary whenever you change your locale
> > settings(the LANG environment variable).
> 
> Well, this is not true.  Maybe you mean when you change between UTF-8
> and non UTF-8 locale?

Are you sure? I say it's true for all multibyte locales. At least I have
problems changing from Shift_JIS Japanese to EUC-JP Japanese. If you
don't have this problem, than we are talking about different things.

> 
> Can you give me some more information on exactly what problem you were
> seeing originally, and exactly what you did to fix the problem?

That's a very good point, because maybe we are talking about different
issues. 

Originally, I was running GNUcash (1.6.x) under ja_JP.eucJP. This went
fine. Then I changed my whole user to UTF-8 because I am working
multilingual environment. Suddenly all Japanese I had entered so far
went cryptic, I had lots of errors on the command line and Gnucash would
crash randomly. So I investigated the problems, posted my findings to
this mailing list, undertook the steps above and had no problems ever
since. 

> 
> Thanks, Jon

I just want to say, that UTF-8 is definitly working, when you have the
correct configuration.


Reinke



> 
> -- 
> -**-*-*---*-*---*-*---*-----*-*-----*---*-*---*-----*-----*-*-----*---
>  Jon Lapham  <lapham at extracta.com.br>          Rio de Janeiro, Brasil
>  Work: Extracta Mole'culas Naturais SA     http://www.extracta.com.br/
>  Web: http://www.jandr.org/
> ***-*--*----*-------*------------*--------------------*---------------
> 
> 
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at lists.gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel




More information about the gnucash-devel mailing list