Linux中文解决

中文编码问题

  1. 安装中文语言包
  2. locale -a | grep zh 查看是否有中文语言包
  3. local 查看是否 LC_TYPE 为空
  4. 在 /etc/profile.d/ 下创建 lc_type.sh
  5. 在 lc_type.sh 添加中添加 export LC_TYPE="zh_CN.utf8"

Pillow python 绘图中文乱码

  1. 在 /usr/share/fonts 下创建 chinese 目录, 用与存放上传过来的支持中文字体的字体文件 .tff
  2. 修改配置文件 /etc/fonts/fonts.conf, 在 Font directory list 中添加 <dir>/usr/share/fonts/chinese</dir>
  3. 使用命令 fc-list 查看是否有 chinese, 应该是没有的, 需要使用命令 fc-cache 重新读取配置文件即可
posted @ 2020-04-05 11:47  gogogo11  阅读(227)  评论(0编辑  收藏  举报