Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

manpath: can't set the locale; make sure $LC_* and $LANG are correct

Tags:

locale

People also ask

How do I change my locale to UTF-8?

To enable UTF-8 mode, use ". UTF8" as the code page when using setlocale . For example, setlocale(LC_ALL, ". UTF8") will use the current default Windows ANSI code page (ACP) for the locale and UTF-8 for the code page.

How do I fix my locale issue?

One solution to fix this issue, first run the locale command to list the locales currently defined for your user account. To generate the missing locale and reconfigure locales, identify the name of your locale ( in my case de_DE. UTF-8 ), or use one another one that you prefer, such as en_US. UTF-8 .

Where is locale Linux?

You can find global locale settings in the following files: /etc/default/locale – on Ubuntu/Debian. /etc/locale.


Try this https://gist.github.com/SimonSun1988/2ef7db45e46b889783647d941ec15e4d

sudo locale-gen "en_US.UTF-8"
sudo dpkg-reconfigure locales

and in file /etc/default/locale add line LC_ALL="en_US.UTF-8" and relogin to your server.


For CentOS this worked for me.

Add these lines to /etc/environment

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

Edit your /etc/locale.gen then uncomment the following line:

en_GB.UTF-8 UTF-8

Run:

sudo locale-gen en_GB.UTF-8 UTF-8
sudo update-locale en_GB.UTF-8 UTF-8
export LANGUAGE=en_GB.UTF-8
export LC_ALL=en_GB.UTF-8

Verify it;

locale

You may get:

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

And Done !!!