V St, 05. 11. 2003 v 14:50, Spider píše:

> Ahh, thats very true. Except that I'd still want it documented. Yep,
> I'm having a drive for UTF-8 right now, I've ran into places where I
> need filenames in UTF-8 and most things have started to break otherwise.
>  unpleasant compability problems. 

These problems are currently discussed in glib bugzilla:
http://bugzilla.gnome.org/show_bug.cgi?id=114068


And there are my ideas, what needs to be done for seamless UTF-8
support:

0) baselayout: Add "official" way to set system default locale:
/etc/rc.conf or /etc/env.d/{number}locale (or similar).

1) glibc: Generate UTF-8 locales for all languages, if unicode USE flag
is on. Either as patch, or ex-post:
for i in ...... ; do
localedef -i $i -f UTF-8 -u charids.894 $i.UTF-8
done

2) Enable UTF-8 locales in GDM:

Two alternatives:

# Create UTF-8 for all locales.
sed 's:\([^     ]*\)\([         ][      ]*\)\(.*\)UTF-8,\(.*\):\1       \2\4,\3UTF-8\
\1(UTF-8)\2\3UTF-8,\4:g' <config/locale.alias | sed 's:^\([^    ][^     ][^
        ][^     ][^     ][^     ][^     ][^     ]\)*(UTF-8):&   :' 
>config/locale.alias~
mv config/locale.alias~ config/locale.alias

# Prefer non UTF-8 for all locales.
sed 's:\([^     ]*\)\([         ][      ]*\)\(.*\)UTF-8,\(.*\):\1       \2\4,\3UTF-8:g'
<config/locale.alias | sed 's:^\([^     ][^     ][^     ][^     ][^     ][^     ][^    
 ][^
        ]\)*(UTF-8):&   :' >config/locale.alias~
mv config/locale.alias~ config/locale.alias

3) Grab Redhat patches for most problematic applications (mc, slang,
maybe ncurses).



Setting language mini HOWTO:


LANG

LANG sets overall NLS support. Use LANG in form cs_CZ, cs_CZ.UTF-8 or
[EMAIL PROTECTED] Avoid cs (X does not like it), cs_CZ.utf8 (again -
X doesn't like it) and czech (X and some old apps does not like it -
very old gtk). Test: run LANG={mysetup} xcalc. No warning must appear.

Note: localedef --list shows cs_CZ.utf8. It's because glibc ignores all
'-' characters and converts charset to lowercase.


LANGUAGE

LANGUAGE can be optionally set to list of languages for searching
messages, e. g. cs_CZ:sk_SK. Applications translated to cs will use cs,
applications translated to sk but not cs will use sk.

Warning: Some desktop managers with ability to set session language
(GDM) does not properly set/reset this variable and it is inherited to
all locale setups. It can cause strange setups.


LC_{category} - Set it for special purposes, if you want to use
different locales for messages, ctypes, collating etc.

LC_ALL - no need to set in environment. It nearly duplicates LANG. Nice
to use in scripts, not environment.

-- 
Stanislav Brabec
http://www.penguin.cz/~utx, ICQ 116020046

--
[EMAIL PROTECTED] mailing list

Reply via email to