[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Locale Problem



On Nov 14, 2007 5:58 AM, Jeff Grossman <jeff@stikman.com> wrote:
> Kumar Appaiah wrote:
> > On Tue, Nov 13, 2007 at 09:18:49PM -0800, Jeff Grossman wrote:
> >
> >> I get the following error messages whenever I update or install a program
> >> with aptitude:
> >>
> >> perl: warning: Setting locale failed.
> >> perl: warning: Please check that your locale settings:
> >>
> > [snip]
> >
> > The simplest thing would be to set export LANG=en_US (or similar) in
> > your bashrc. But the proper way would be to run dpkg-reconfigure
> > locales and choose only the locales you are intersted in and set the
> > right default locale.
> >
> > HTH.
> >
> > Kumar
> >
> I have run the "dpkg-reconfigure locales" command numerous times.  Here
> is the output of my /etc/locale.gen file:
>
> root@apple /etc # less locale.gen
> # This file lists locales that you wish to have built. You can find a list
> # of valid supported locales at /usr/share/i18n/SUPPORTED. Other
> # combinations are possible, but may not be well tested. If you change
> # this file, you need to rerun locale-gen.
> #
>
> en_US.UTF-8 UTF-8
>
> en_US ISO-8859-1
> en_US.ISO-8859-15 ISO-8859-15
> root@apple /etc #
>
> And, here is what I have in my bash.bashrc file:
>
> export LC_ALL="en_US.UTF-8 UTF-8"
> export LANG="en_US"
> export LANGUAGE="en_US"
>
> And, I get the error about the missing locale files.  If I change the
> "export LC_ALL="en_US.UTF-8 UTF-8" to "export LC_ALL="en_US" then I do
> not get the error from Perl.  But, I do get the following output when I
> run 'aptitude update' which seems weird to me:
>
> Get:1 http://ftp.us.debian.org stable Release.gpg [378B]
> Ign http://ftp.us.debian.org stable/main Translation-en_US
> Ign http://ftp.us.debian.org stable/contrib Translation-en_US
>
> What seems weird to me is the "Translation-en_US" part.  I don't have
> that output if I use hte UTF-8 version of the locale.
>
> I guess one of my main questions is, what LC_ALL, LANG, and LANGUAGE
> settings do I use for US/English?

LC_ALL overrides everything else. It is often left unset, and each of the
other LC values specified individually, so that one of them could be
changed without going back and also unsetting LC_ALL.  But it doesn't
hurt to just use LC_ALL.

The form "en_US.UTF-8 UTF-8" is wrong, it should always be
"$language_$VARIANT.$ENCODING" - eg "en_US.UTF-8".
I think leaving off the encoding defaults to "C" (ASCII), or
maybe ISO.

Instead of setting the values in bashrc, you could put them
in /etc/default/locale. On my system there is also a
/etc/default/locale.dpkg-dist. I don't know what it is for but
unlike the "locale" file it had a nice commented list of all
LC variables, so I copied it over "locale" and gave everything
except LANGUAGE, LC_ALL and LC_TIME values of
en_US.UTF-8. I use en_DK.UTF-8 for time, because I like
ls -l to list times as YYYY-MM-DD HH:MM (24 hour clock).
I left LANGUAGE and LC_ALL unset.


Cheers,
Kelly Clowers



Reply to: