记录 Ubuntu18.04 中文乱码,解决方法

1.查看现有语言环境

locale

2.如果没有 en_US.UTF-8 则安装

locale-gen en_US.UTF-8

3.可用语言环境

locale -a

4.永久更改编码,运行以下命令。 注意 如果是 docker 容器,重启会无效

echo "export LC_ALL=en_US.UTF-8" >> /etc/profile

docker 镜像 运行以下代码

echo "export LC_ALL=en_US.UTF-8" >> /root/.bashrc

5.要让刚才的修改马上生效,需要执行以下命令 完成

source /etc/profile

QQ交流群 602748730

你可能感兴趣的:(记录 Ubuntu18.04 中文乱码,解决方法)