pkgsrc-Users archive

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

Re: perl and utf8





I reported that Perl complained once I changed to a utf8 locale:

    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LC_ALL = (unset),
            LC_CTYPE = "en_CA.UTF-8",
            LC_COLLATE = "C",
            LANG = "en_CA.UTF-8"
        are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").

My locale settings are:

  LANG="en_CA.UTF-8"
  LC_CTYPE="en_CA.UTF-8"
  LC_COLLATE="C"
  LC_TIME="C"
  LC_NUMERIC="C"
  LC_MONETARY="C"
  LC_MESSAGES="en_CA.UTF-8"
  LC_ALL=""

On Sun, 10 Jan 2010, OBATA Akio suggested:

Just workaround:
exactly set LC_COLLATE=C LC_NUMERIC=C or PERL_BADLANG=0.

As you can see above, "LC_COLLATE=C LC_NUMERIC=C" were already the
case.  PERL_BADLANG just sweeps the problem under the carpet.

I had written:

and "locale -a" *does* return en_CA.UTF-8 as one of its entries.

But it lies!  Or at least, there's no "en_CA.UTF-8" directory
in /usr/share/locale.  There *is* however a "en_US.UTF-8",
and if I use that, Perl is happy.

Interestingly, the file /usr/share/locale/locale.alias contains:

  en_CA.UTF-8/LC_CTYPE            en_US.UTF-8
  en_CA.UTF-8/LC_MESSAGES         /FORCE

While for most purposes now I can use en_US.UTF-8 just as well,
if I wanted my messages in another language I'd be unhappy.
I'm going to play with this a bit more and see if I can
straighten it out a bit better.

Anne.


Home | Main Index | Thread Index | Old Index