Saturday, March 02, 2013

Annoying "perl: warning: Setting locale failed"

This post shows a simple way of removing this annoying warning when running perl in linux.


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").

Solution:

on your home directory:


1. Edit your user bash_profile

vi .bash_profile

2. Insert the following:

export LANGUAGE=en_US.UTF-8

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

3. Rerun your Bash Profile

. ~/.bash_profile 


Hope this helps.

3 comments:

srini said...

Great post thanks,
for csh shell user below env in .cshrc file

setenv LANG en_US.UTF-8
setenv LC_ALL en_US.UTF-8
setenv LANGUAGE en_US.UTF-8

Rubén Rivero Capriles said...

great thanks so much for your useful, clear and easy explanation.

derrick said...

no worries!