Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Here's the output of locale:

LANG=zh_CN.GBK
LC_CTYPE="zh_CN.GBK"
LC_NUMERIC="zh_CN.GBK"
LC_TIME="zh_CN.GBK"
LC_COLLATE="zh_CN.GBK"
LC_MONETARY="zh_CN.GBK"
LC_MESSAGES="zh_CN.GBK"
LC_PAPER="zh_CN.GBK"
LC_NAME="zh_CN.GBK"
LC_ADDRESS="zh_CN.GBK"
LC_TELEPHONE="zh_CN.GBK"
LC_MEASUREMENT="zh_CN.GBK"
LC_IDENTIFICATION="zh_CN.GBK"
LC_ALL=

How can I change all of them to UTF8?

UPDATE

How can I persist the locale in centos 5.5?

share|improve this question
add comment

3 Answers

Do you mean in the current session or permanently?

If you just need it in the current shell you can export the LC_ALL variable. For example:

export LC_ALL=en_US.UTF-8

If you mean to do it permanently or system-wide it varies from distribution from distribution. What's yours?

share|improve this answer
    
mine is centos 5.5. –  locale May 31 '11 at 3:22
add comment

In CentOS try with system-config-language command. That's the CentOS way :) Also you can try with:

localedef -c -f UTF-8 -i en_US en_US.UTF-8
export LC_ALL=en_US.UTF-8
share|improve this answer
    
what's localedef -c -f UTF-8 -i en_US en_US.UTF-8 for? –  locale May 31 '11 at 5:03
    
It's used to define your locale to en_US and en_US.UTF-8 –  boris quiroz Jun 2 '11 at 23:25
add comment

Red-Hat like distros (Centos, SL) come with file

/etc/sysconfig/i18n

which contains by default (well, in my case)

LANG="en_GB"

SYSFONT="latarcyrheb-sun16"

And above file is being sourced by /etc/profile.d/lang.sh

I my case I wanted to change en_GB.UTF-8 to en_GB.iso88591 so I found that “proper” way of doing it was to append /etc/sysconfig/i18n with

CHARSET="iso8895-1"

Once that done locale for each account on the system should be saying:

me@wark:~ $ locale

LANG=en_GB.UTF-8

LC_CTYPE="en_GB.iso88591"

LC_NUMERIC="en_GB.iso88591"

LC_TIME="en_GB.iso88591"

LC_COLLATE="en_GB.iso88591"

LC_MONETARY="en_GB.iso88591"

LC_MESSAGES="en_GB.iso88591"

LC_PAPER="en_GB.iso88591"

LC_NAME="en_GB.iso88591"

LC_ADDRESS="en_GB.iso88591"

LC_TELEPHONE="en_GB.iso88591"

LC_MEASUREMENT="en_GB.iso88591"

LC_IDENTIFICATION="en_GB.iso88591"

LC_ALL=en_GB.iso88591

share|improve this answer
add comment

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.