Chinaunix首页 | 论坛 | 博客
  • 博客访问: 336777
  • 博文数量: 135
  • 博客积分: 4637
  • 博客等级: 上校
  • 技术积分: 1410
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-21 13:22
文章分类

全部博文(135)

文章存档

2013年(12)

2012年(14)

2011年(42)

2010年(22)

2009年(18)

2008年(27)

分类: LINUX

2010-06-18 09:26:36

一. Ubuntu默认的中文字符编码
在/etc/environment中看到:
pprun@pprun-t61:~$sudo gedit /etc/environment
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh:en_US:en"

二. 添加中文字符编码的方法
1. 直接使用locale-gen命令:
pprun@pprun-t61:~$ sudo locale-gen zh_CN.GB18030
pprun@pprun-t61:~$ cd /usr/lib/locale/
可以看到生成了一个zh_CN.gb18030文件夹
pprun@pprun-t61:~$ gedit /var/lib/locales/supported.d/local
文件中多了一行:zh_CN.GB18030 GB18030

2. 通过修改/var/lib/locales/supported.d/local文件
pprun@pprun-t61:~$ sudo gedit /var/lib/locales/supported.d/local
zh_CN.UTF-8 UTF-8
en_US.UTF-8 UTF-8

增加一行:
zh_CN.GBK GBK
后保存后退出。

pprun@pprun-t61:~$ sudo dpkg-reconfigure locales

Generating locales...
...
en_US.UTF-8... done
en_ZA.UTF-8... done
en_ZW.UTF-8... done
zh_CN.GBK... done
zh_CN.UTF-8... up-to-date
...
Generation complete.

即可生成相应文件:/usr/lib/locale/zh_CN.gbk/

阅读(818) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~