RFC - UTF patch

Jon Lapham lapham at extracta.com.br
Thu Sep 4 15:17:31 CDT 2003


Here is my "until we have the gnome2 port" solution to the UTF-8 problems.

The attached file is a drop-in replacement for the bin/gnucash script. 
To test, simply copy the script I attached to your "--prefix"/bin/ 
directory and run it.  This solves all my UTF-8 problems... how 'bout yours?

Should work with OSes that use LANG or LANGUAGE to set the language.  If 
your OS uses some other mechanism, at least you aren't any worse off. 
Let me know how other OSes deal with langauge settings and I'll make the 
appropriate adjustments.

Here is the actual bash code snippet I wrote (not the actual script), if 
bash masters out there want to comment:

# SHOWTEXT
if [ $LANG ] && [ `echo $LANG | grep ".UTF-8"` ];
then
    NEWLANG=`echo $LANG | sed -e "s/.UTF-8$//"`;
    if [ -n $SHOWTEXT ];
    then
       echo "Your LANG env var is set to $LANG.";
       echo "GnuCash does not support UTF-8 encoding well.";
       echo "Changing your LANG var to $NEWLANG";
    fi
    LANG=$NEWLANG;
    export LANG;
elif [ $LANGUAGE ] && [ `echo $LANGUAGE | grep ".UTF-8"` ];
then
    NEWLANG=`echo $LANGUAGE | sed -e "s/.UTF-8$//"`;
    if [ $SHOWTEXT == 1 ];
    then
       echo "Your LANGUAGE env var is set to $LANGUAGE.";
       echo "GnuCash does not support UTF-8 encoding well.";
       echo "Changing your LANGUAGE var to $NEWLANG";
    fi
    LANGUAGE=$NEWLANG;
    export LANGUAGE;
fi


-- 
-**-*-*---*-*---*-*---*-----*-*-----*---*-*---*-----*-----*-*-----*---
  Jon Lapham  <lapham at extracta.com.br>          Rio de Janeiro, Brasil
  Work: Extracta Moléculas Naturais SA     http://www.extracta.com.br/
  Web: http://www.jandr.org/
***-*--*----*-------*------------*--------------------*---------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnucash.gz
Type: application/x-gzip
Size: 508 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20030904/7e897c60/gnucash.bin


More information about the gnucash-devel mailing list