zoukankan      html  css  js  c++  java
  • CentOS安装中文支持包

    修改配置文件

    #CentOS 6从下面进入配置文件
    #vi /etc/sysconfig/i18n
    
    #CentOS 7 
    #vi /etc/locale.conf
    LANG="zh_CN.UTF-8"

    改为中文字符集

    然后在查看更改后的系统语言变量

    [root@5c46832b5c01 ~]# locale
    locale: Cannot set LC_CTYPE to default locale: No such file or directory
    locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    locale: Cannot set LC_ALL to default locale: No such file or directory
    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=

    查看语言包

    [root@5c46832b5c01 ~]# locale -a
    locale: Cannot set LC_CTYPE to default locale: No such file or directory
    locale: 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
    C
    POSIX
    en_US.utf8

    发现没有中文,安装一个,注意7跟6不一样

    # yum install kde-l10n-Chinese
    #yum reinstall glibc-common

    再次查看

    [root@ce1d2002a999 ~]# cat test  
    我的意思是
    [root@ce1d2002a999 ~]# vi test 
    
    我的意思是

    更改完毕!!

    注意:

    1、ftp传上来文件是乱码,服务器本身上新建中文是正常的

  • 相关阅读:
    hdu 3440 House Man
    hdu 2018 母牛的故事
    poj 1639 Picnic Planning 度限制mst
    uva 10870
    矩阵快速幂 模板与简单讲解
    1118sync_binlog innodb_flush_log_at_trx_commit 浅析
    1117Mysql prepare预处理语句
    1116Xlinux初学习之正则表达式和通配符
    1111分析存储引擎
    1111MySQL配置参数详解
  • 原文地址:https://www.cnblogs.com/xiaoruilin/p/8727357.html
Copyright © 2011-2022 走看看