惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - xiahaitao

Python中使用 * 处理列表 ssh-copy-id端口问题 linux下邮件查看命令 账户家目录修复过程 CCNA Day3 CCNA Day2 CCNA Day1 linux下创建用户并设置密码 国内常用NTP服务器地址及IP 虚拟光驱导致无法安装光驱驱动的解决方法 使用grep查找文件并输出 cactil安装--解决缺少snmpwalk包的问题 华为S5300交换机里的,有啥用? vim替换字符串指令 用linux做双线接入的路由器 intel显卡linux驱动 cacti安装完后就停留在登陆界面,输入默认的用户名密码登陆不进去! sftpd 启动 报错: vsftpd:500 OOPS: bad bool value in config file for: anonymous_enable Linux iptables配置FTP的主动和被动模式
Centos语言问题
xiahaitao · 2012-09-10 · via 博客园 - xiahaitao

安装所有的中文字体

yum install fonts-chinese

安装中文支持

yum install fonts-IOS885Array

查看中文支持情况

locale

一般只要是UTF-8编码就对了。

显示结果

LANG=zh_CN.UTF-8

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=

如果在安装CentOS的时候没有选择中文,可以通过以下方式安装中文语言支持。
# yum install "@Chinese Support"
也可以通过yum grouplist来列出所有的group和languages

配置成中文支持

查看    #echo $LANG

一般中文系统应该是zh_CN.utf-8  , 如果安装的英文版本并且安装了中文支持包是 en_US.UTF-8修改/etc/sysconfig/language文件,将RC_LANG, RC_LC_ALL设置为zh_CN.GB2312, 同时将ROOT_USES_LANG设置为"yes"


默认安装英文版本的显示如下内容

# cat /etc/sysconfig/i18n

LANG="en_US.UTF-8"

SYSFONT="latarcyrheb-sun16"

linux piconv文件gb2312转UTF-8

用 iconv , 没有就用 piconv,用法

iconv -f "gbk" -t "utf-8" < infile > outfile

piconv -f "gbk" -t "utf-8" < infile > outfile

如果太多档案,写个 bash 脚本,放到要转换编码的目录

里,脚本这样

#! /bin/bash

ICONV=iconv

if ! which $ICONV &> /dev/null

   then

      ICONV=piconv

fi

for i in *Action.cpp

  do

     $ICONV -f "gbk" -t "utf-8" < "$i" > "$i.utf8"

     ret=$?

     if [ $ret -eq 0 ] ; then

        mv -f "$i" "$i.backup"

        mv -f "$i.utf8" "$i"

       else

         echo "fail to convert $i from gbk to utf-8"

       fi

   done

  exit $ret

#end

这脚本会把你原来的gbk编码档案转换为 utf8 的新档案,原档会更名为 *Action.cpp.backup, 没测试, :)

部分内容来自网络