GnuCashHowTo

Revision 1 as of 2006-01-16 22:09:50

Clear message

How to run GnuCash when your locale is UTF-8

  1. Check that you have the equivalent ISO8859-1 encoding available for your default locale:
     sudo dpkg-reconfigure locales
  2. If your default locale is, say, en_GB.UTF-8, then make sure that en_GB ISO8859-1 is also selected.
  3. In a terminal window, temporarily change your locale to make sure that it works:

     export LANG=en_GB
     gnucash
  4. Check for any error messages about the locale in the terminal window and that in GnuCash (especially in reports) that there are no strange symbols.

  5. Create the following script to /usr/local/bin/gnucash or ~/bin/gnucash to make the changes happen on the fly:

     #!/bin/bash
     # Wrapper to get correct LANG (not with UTF-8) for the application /usr/bin/gnucash
     # Automatically extract MyLocale from the string 'LANG=MyLocale.UTF-8' which is output by locale
     MyLocale=$(locale | grep LANG | cut -f1 -d'.' | cut -f2 -d'=')
     export LANG=$MyLocale
     /usr/bin/gnucash
  6. If LC_MONETARY is set to a different value from LANG then the above becomes:

     #!/bin/bash
     # Wrapper to get correct LANG (not with UTF-8) for the application /usr/bin/gnucash
     # Automatically extract MyLocale from the string 'LANG=MyLocale.UTF-8' which is output by locale
     MyLocale=$(locale | grep LANG | cut -f1 -d'.' | cut -f2 -d'=')
     export LANG=$MyLocale
     MyLocale=$(locale | grep LC_MONETARY | cut -f1 -d'.' | cut -f2 -d'=')
     export LC_MONETARY=$MyLocale
     /usr/bin/gnucash