收藏文章 楼主

linux centos ubuntu 设置中文 UTF-8 编码 utf

版块:linux   类型:置顶   作者:小绿叶技术博客   查看:2260   回复:0   获赞:0   时间:2020-01-05 09:35:58

centos 需要安装 UTF-8 编码

### 1.服务器端配置

yum groupinstall -y "fonts"            # groupinstall 安装软件并安装依赖

yum install *chinese -y          # centos 安装所有Chinese的包


apt-get install ttf-wqy-zenhei language-pack-zh-hans -y

                                                       # ubuntu 安装中文 ,切换命令:   dpkg-reconfigure locales   然后选择 zh_cn.uft8


# yum install -y langpacks-zh_CN   # centos8 与 redhat8 中文语言包


sed -i 's/LANG=.*/LANG="zh_CN.UTF-8"/g' /etc/locale.conf

# 修改为中文,/g 作用于双引号不被解析

source /etc/locale.conf # 立即生效

locale # 查看安装的编码

date # 显示时间,看是否为中文显示

reboot # 重启, # halt  关机


####  2.本地xshell crt 配置 

【 选项 】--- 【 全局选项 】 ---  【 默认会话 】--- 【 编辑默认设置 】--- 【 外观 】---【 字符编码 】---【 UTF-8 】---【 关闭软件重新打开 】



--------  nginx 同时支持gbk 和 utf-8 编码  ---------

find / -name nginx.conf # 查找nginx 配置文件

# /nginx/conf/nginx.conf    类似于这种路径

server {

    listen       80;

    server_name  localhost;


    charset ISO-88509-1; # ISO-88509-1 这是都兼容,可以改为 uft-8


}

提供企业建站服务,免费网防系统,提交信息登录 http://yundun.ddoss.cn 邮箱: proposal@ddoss.cn 
回复列表
默认   热门   正序   倒序

回复:linux centos ubuntu 设置中文 UTF-8 编码 utf

头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息