https://access.redhat.com/solutions/254623
Supporting the Microsoft Character Set (CP1252) on RHEL
SOLUTION 已验证 - 已更新 2013年五月2日01:22 -
环境
Red Hat Enterprise Linux (RHEL) 5
问题
There may be a need to support the Microsoft character set of 1252 to support characters generated on the MS platform and subsequently passed to the Linux server. One example would be the Euro symbol.
决议
Create the "locale.character_set" definition file:
# localedef -f CP1252 -i de_DE /usr/lib/locale/de_DE.cp1252
Now export the "LANG" environment variable:
# export LANG=de_DE.cp1252
诊断步骤
[root@test ~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.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=
[root@test ~]# localedef -f CP1252 -i de_DE /usr/lib/locale/de_DE.cp1252
[root@test ~]# export LANG=de_DE.cp1252
[root@test ~]# locale
LANG=de_DE.cp1252
LC_CTYPE="de_DE.cp1252"
LC_NUMERIC="de_DE.cp1252"
LC_TIME="de_DE.cp1252"
LC_COLLATE="de_DE.cp1252"
LC_MONETARY="de_DE.cp1252"
LC_MESSAGES="de_DE.cp1252"
LC_PAPER="de_DE.cp1252"
LC_NAME="de_DE.cp1252"
LC_ADDRESS="de_DE.cp1252"
LC_TELEPHONE="de_DE.cp1252"
LC_MEASUREMENT="de_DE.cp1252"
LC_IDENTIFICATION="de_DE.cp1252"
LC_ALL=

本文介绍如何在Red Hat Enterprise Linux 5上通过创建locale定义文件并设置LANG环境变量来支持Microsoft CP1252字符集,以处理来自MS平台的特殊字符,如欧元符号。
18万+

被折叠的 条评论
为什么被折叠?



