Something interesting

We are what we repeatedly do. Excellence, therefore, is not an act, but a habit.

Ubuntu – Chinese under English locale

Posted by yuzhou on November 10, 2006

Generate locales:

1. sudo cp /var/lib/locales/supported.d/local /var/lib/locales/supported.d/local.old
2. sudo cp /usr/share/i18n/SUPPORTED /var/lib/locales/supported.d/local

or

1. sudo nano /var/lib/locales/supported.d/local
2. add

zh_CN.UTF-8 UTF-8
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
zh_CN.GB18030 GB18030
zh_HK.UTF-8 UTF-8
zh_HK BIG5-HKSCS
zh_TW.UTF-8 UTF-8
zh_TW.BIG5 BIG5

3. sudo dpkg-reconfigure –force locales
在切换到英文界面之后,编辑配置文件 /etc/environment,增加或者修改相应的 locale 设置:
LC_CTYPE=”zh_CN.UTF-8″ # “zh_CN.GBK” to cover GB2312 and 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=
LANGUAGE=”en_US:en”
GST_ID3_TAG_ENCODING=GBK
LANG=en_US.UTF-8

这样使得在需要使用中文的地方能够良好的表现中文,而其他地方能够展现英文。

HOWTO: setup Chinese support under English locale from Ubuntu Chinese Forum

Or 在 Ubuntu 英文界面下处理中文

Advertisements

3 Responses to “Ubuntu – Chinese under English locale”

  1. […] 关于在US locale下处理中文 Published February 8th, 2007 Linux 那天看到一篇文章,说的比我的方法高级。在这里贴一下 […]

  2. Qian said

    Just for clarification: there are two dashes(-) right before “force” in the command of step 3, though it looks like one dash.

  3. […] 那天看到一篇文章,说的比我的方法高级。在这里贴一下 […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: