ubuntu下设置locale

在bash下中文乱码,因为locale没有正确设置,在bash下执行:

/usr/share/locales/install-language-pack zh_CN

sudo locale-gen

编辑用户主目录下 ~/.bashrc 文件,添加内容

export LANG="zh_CN.UTF-8"
export LANGUAGE="zh_CN.UTF-8"
export LC_ALL="zh_CN.UTF-8"
原文地址:https://www.cnblogs.com/shengrui/p/3793041.html