Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hello. I'm getting some warnings when running perl:

perl -e 'print "Hello\n";'
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Running:

export LC_ALL=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

fixes the warnings for the current shell session

Is there any permanent solution?

share|improve this question
    
which OS is this ? WakiMiko's answer is correct for debian based linux distributions. Others would need different actions. (sorry just saw the debian tag, would be better to add the distribution in the question itself) – 0xAF Jun 25 '12 at 17:32
    
@0xAF, Debian 6.0 64bit – Jevgeni Smirnov Jun 26 '12 at 5:12

Try dpkg-reconfigure locales.

share|improve this answer
    
I'v tried it. I choose English utf-8, but after my relogin I am having the same problem. – Jevgeni Smirnov Jun 26 '12 at 5:12

So I was having this exact problem and on debian this can be done with the update-locale utility

update-locale --reset

will cause the /etc/default/locale file to be ignored (it simply comments out the LANG variable); resulting in a locale of:

LANG=C
LANGUAGE=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C

update-locale LANG=en_US.UTF-8

will set your LANG to LANG to... you guessed it en_US.UTF-8 resulting in locale generating:

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

And finally just to cover all my bases...

update-locale LANG=C

will set your LANG to LANG to C resulting in locale outputting:

LANG=C
LANGUAGE=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

I put this on unix too, which so I could try and help, cause this was driving me nuts. OCD and all. -Eric

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.