zoukankan      html  css  js  c++  java
  • Linux CentOS7 字符集

    CentOS 7字符集的问题与6有点区别,会出现下面问题,查看是中文,vi进入就变成乱码了

    生产中修改配置文件

    1.  [root@ce1d2002a999 ~]# cat /etc/locale.conf
    2.  LANG="zh_CN.UTF-8"

    改为中文字符集

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

    1.  [root@5c46832b5c01 ~]# locale
    2.  locale: Cannot set LC_CTYPE to default locale: No such file or directory
    3.  locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    4.  locale: Cannot set LC_ALL to default locale: No such file or directory
    5.  LANG=zh_CN.UTF-8
    6.  LC_CTYPE="zh_CN.UTF-8"
    7.  LC_NUMERIC="zh_CN.UTF-8"
    8.  LC_TIME="zh_CN.UTF-8"
    9.  LC_COLLATE="zh_CN.UTF-8"
    10.  LC_MONETARY="zh_CN.UTF-8"
    11.  LC_MESSAGES="zh_CN.UTF-8"
    12.  LC_PAPER="zh_CN.UTF-8"
    13.  LC_NAME="zh_CN.UTF-8"
    14.  LC_ADDRESS="zh_CN.UTF-8"
    15.  LC_TELEPHONE="zh_CN.UTF-8"
    16.  LC_MEASUREMENT="zh_CN.UTF-8"
    17.  LC_IDENTIFICATION="zh_CN.UTF-8"
    18.  LC_ALL=

    查看语言包

    1.  [root@5c46832b5c01 ~]# locale -a
    2.  locale: Cannot set LC_CTYPE to default locale: No such file or directory
    3.  locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    4.  locale: Cannot set LC_COLLATE to default locale: No such file or directory
    5.  C
    6.  POSIX
    7.  en_US.utf8

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

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

    再次查看

    1.  [root@ce1d2002a999 ~]# cat test
    2.  我的意思是
    3.  [root@ce1d2002a999 ~]# vi test 
  • 相关阅读:
    十天冲刺个人博客四
    十天冲刺个人博客三
    十天冲刺个人博客二
    软件工程课堂七(单词统计)
    十天冲刺个人博客一
    软件工程第九周总结
    人月神话阅读笔记03
    软件工程课堂六(《飘》单词统计)
    软件工程第八周总结
    跨域
  • 原文地址:https://www.cnblogs.com/xibuhaohao/p/12001485.html
Copyright © 2011-2022 走看看