首页 > 代码库 > Ubuntu 12.04 Server中文下配置UTF-8中文/英文环境

Ubuntu 12.04 Server中文下配置UTF-8中文/英文环境


#安装中文语言包

apt-get install language-pack-zh-hans


locale-gen


cd /etc/default

cp locale locale.bak


#中文

cat <<EOF >locale

LANG="zh_CN.UTF-8"

LANGUAGE="zh_CN:en"

LC_CTYPE="zh_CN.UTF-8"

EOF


#重启Ubuntu Server

reboot


#-----


#英文

cat <<EOF >locale

LANG="en_US.UTF-8"

LANGUAGE="en_US"

LC_CTYPE=C

EOF


#其它

LANG=zh_CN.UTF-8

LANGUAGE=zh_CN:en

LC_CTYPE="zh_CN.UTF-8"

LC_NUMERIC="zh_CN.UTF-8"

LC_TIME="zh_CN.UTF-8"

LC_COLLATE="zh_CN.UTF-8"

LC_MONETARY="zh_CN.UTF-8"

LC_MESSAGES="zh_CN.UTF-8"

LC_PAPER="zh_CN.UTF-8"

LC_NAME="zh_CN.UTF-8"

LC_ADDRESS="zh_CN.UTF-8"

LC_TELEPHONE="zh_CN.UTF-8"

LC_MEASUREMENT="zh_CN.UTF-8"

LC_IDENTIFICATION="zh_CN.UTF-8"

LC_ALL=zh_CN.UTF-8


Ubuntu 12.04 Server中文下配置UTF-8中文/英文环境