解决Linux系统中文显示为乱码的方法
2012-11-09 06:15
295 查看
XP里宋体字体文件的位置和文件名是:C:\WINDOWS\Fonts\simsun.ttc
把simsun.ttc文件复制到Linux系统中(我放在/bak/fonts下)。
现将我完整的命令以及返回参数粘贴如下:
[root@localhost ~]# cd /usr/share/fonts
[root@localhost fonts]# mkdir cnfonts
[root@localhost fonts]# cd cnfonts
[root@localhost cnfonts]# mkdir simsun
[root@localhost cnfonts]# cp /bak/fonts/simsun.ttc /usr/share/fonts/cnfonts/simsun
[root@localhost cnfonts]# cd simsun
[root@localhost simsun]# ls -l
total 10284
-rw-r--r-- 1 root root 10512288 Apr 24 10:35 simsun.ttc
[root@localhost simsun]# mkfontscale
[root@localhost simsun]# ls -l
total 10288
-rw-r--r-- 1 root root 716 Apr 24 10:38 fonts.scale
-rw-r--r-- 1 root root 10512288 Apr 24 10:35 simsun.ttc
[root@localhost simsun]# mkfontdir
[root@localhost simsun]# ls -l
total 10292
-rw-r--r-- 1 root root 716 Apr 24 10:39 fonts.dir
-rw-r--r-- 1 root root 716 Apr 24 10:38 fonts.scale
-rw-r--r-- 1 root root 10512288 Apr 24 10:35 simsun.ttc
[root@localhost simsun]# pwd
/usr/share/fonts/cnfonts/simsun
[root@localhost simsun]# chkfontpath --add /usr/share/fonts/cnfonts/simsun/
[root@localhost simsun]# service xfs reload
Reloading xfs: [ OK ]
[root@localhost simsun]#
到此,字体安装完毕,注销Linux系统,使用Xwindow登录,在登陆框将语言选择为“中文(大陆)”,再登陆系统就可以正常显示中文了。
至于如何将XP系统里的 simsun.ttc 文件复制到 Linux下面,各有各的方法。我是在虚拟机里运行Linux的,所以直接在XP里创建了FTP,在Linux里面登录xp的ftp把windows里的文件复制到 Linux 里面的。
袁
浙工局·宁波
2009.4.24
本文出自 “袁经春.技术博客” 博客,请务必保留此出处http://xc324.blog.51cto.com/219632/1054647
相关文章推荐
- PLSQL Developer中文显示乱码的解决方法
- asp.net导出Excel显示中文乱码的解决方法
- SecureCRT中文显示乱码的解决方法
- Zabbix 图形显示中文乱码解决方法
- QT 打印中文显示乱码的解决方法
- ubuntu14.04下MYSQL显示中文乱码问题解决方法
- Python 3下Matplotlib画图中文显示乱码的解决方法
- Fedora 18 vim编辑器中文字符显示乱码问题的解决方法
- cocos2d-x win32显示中文乱码解决方法
- Android Studio程序在真机上运行中文显示乱码的解决方法
- gvim和gedit显示中文乱码的解决方法
- Web网站中从Sybase数据库读取的中文显示为乱码的解决方法
- Ubuntu Document viewer 中文显示乱码解决方法
- mysql插入表中的中文显示为乱码或问号的解决方法
- 解决SSH Secure Shell Client显示中文乱码 方法
- JSP页面显示中文乱码解决方法汇总
- SQLServer乱码问题的分析及解决方法(中文字符被存入数据库后,显示为乱码)
- 输入中文,然后在输出,显示为乱码解决方法
- PHP连接MySQL查询结果中文显示乱码解决方法
- 使用SecureCRT登陆RHEL系统显示中文乱码的解决方法