Linux locale 缺失和安装
来源:互联网 发布:python line.split 编辑:程序博客网 时间:2024/05/22 13:21
遇到的问题:
1.-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
Sovled:
locale-gen en_US.UTF-8
update-local en_US.UTF-8
2.en_US.UTF-8... cannot open locale definition file `translit_neutral': No such file or directory
failed
从别的机器复制文件
3.locale -a 出现:
locale: Cannot set LC_CTYPE to default locale: No such file or directorylocale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
POSIX
C
但是 /usr/lib/locales确实有数种字符集。
尝试了
(1) rm -rf /usr/lib/locale/* (2) dpkg-reconfigure locales (3) locale-gen (4) update-local 等等都不行
最后从别的机器上copy了/usr/share/i18n目录覆盖本机的,执行(1)(3) 问题消失。还有一点:which locale 确定正在使用的locale程序是否是预期中的。
小结:
1.全新的字符库编码信息位于 /usr/share/i18n目录下面,其中SUPPORTED中包含可用的所用字符集,格式如下:
。。。zh_HK BIG5-HKSCSzh_SG.UTF-8 UTF-8zh_SG.GBK GBKzh_SG GB2312zh_TW.EUC-TW EUC-TWzh_TW.UTF-8 UTF-8。。。。
其中的charmaps存的每种字符集的映射信息,可以称为最初文件(可能有术语,不管这么多啦)。使用localedef可以生成字符集,就是 locales里面那些东东。
但这些并不是系统中能用的字符集。刚才描述的这些/usr/share/i18n里面的文件只能算是可用的字符集,locale -m可以看到列表。
由于Linux中包含的字符集有几十种,而用户一般能用到的最多就是多种,没必要把所有字符集都集成到系统里。系统里面只使用部分字符集。另外为了让系统能使用,
原始的/usr/share/i18n中德文件要经过处理(complile),能用的字符编码在/usr/lib/locale/下面,成为complied字符集。
2。使用locale-gen可以把原始的/usr/share/i18n中的文件complie成系统能用的/usr/lib/locale/地字符集。locale-gen的参数是要使用的字符集列表,可在在终端下
制定。不然会自动在./var/lib/locales/supported.d/下寻找。编译产生的字符集可以两类方式存在: a.archive file: /usr/lib/locale/locale-archive b.分目录存储。详见man locale-gen
3. /usr/share/i18n里面的东西操作系统无关,不同体系结构不同系统可以通用,若有缺失,从其他地方复制来便可。
Error:locale-gen en_US.UTF-8:
en_US.UTF-8... cannot open locale definition file `translit_neutral': No such file or directory failed
en_US.UTF-8... cannot open locale definition file `translit_combining': No such file or directory
-->: 从别的机器上复制/usr/share/i18n/locales/trans×到本地/usr/share/i18n/locales目录。
Useful Link:
http://www.linuxquestions.org/questions/linux-general-1/locale-cannot-set-lc_all-to-default-locale-no-such-file-or-directory-218622/
http://blog.chinaunix.net/uid-20648944-id-2950413.html
- Linux locale 缺失和安装
- linux locale和字符集
- linux locale
- Linux的locale, LC_ALL 和LANG
- Linux的locale, LC_ALL 和LANG
- Python 和 Linux locale 学习笔记
- 浅谈Linux的locale,LC_ALL和LANG
- linux 下安装缺失的包
- 因为linux最小化安装,缺失一些常用命令安装
- linux/debian安装wps以及缺失字体,亲测可用
- Linux--Locale详解
- LINUX LOCALE详解
- Linux中locale 详解
- Linux locale lang
- linux的locale
- Linux中locale 详解
- linux locale设置
- Linux中locale 详解
- VC中CDC与HDC的区别以及二者之间的转换
- linux下svn命令大全
- 【区间动规】 MM不哭
- 寂寞红尘里,你在等待谁的安慰
- CKEditor+CKFinder
- Linux locale 缺失和安装
- 关于HashMap和LinkedHashMap的工作心得
- org.apache.jasper.JasperException:http://java.sun.com/jsp/jstl/core cannot be resolved
- 大容量硬盘录像存储总结
- 关于IoGetDeviceObjectPointer函数
- 变态的报表——TIPTOP 报表
- 【转】生产者消费者模式
- find 命令用法,根据时间,文件权限,查找文件
- JAVA工具方法摘抄