内容目录
vim 中文乱码shell一键命令
cat > ~/.vimrc <<EOF
" 单个双引号为.vimrc的注释符
" 设置vim打开的编码格式
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,latin1
set termencoding=utf-8
" tab替换成空格,默认为8个
set expandtab
" tab替换成的空格数改成4个
set ts=4
" 设个好像是显示时空格对其的设置
set shiftwidth=4
" 语法高亮
syntax on
" 显示行数
" set nu
EOF
linux中文乱码解决
程序日志乱码 输出的文件乱码 脚本执行输出乱码
vim /etc/locale.conf
LANG=en_US.UTF-8
改为
LANG="zh_CN.UTF-8"
然后
echo "export LANG='UTF-8'
export LC_ALL='zh_CN.UTF-8'
export LC_CTYPE='zh_CN.UTF-8'
" >> ~/.bashrc
source ~/.bashrc
整合一键命令
sed -i 's#LANG=.*#LANG=zh_CN.UTF-8#g' /etc/locale.conf
cat /etc/locale.conf
echo "export LANG='UTF-8'
export LC_ALL='zh_CN.UTF-8'
export LC_CTYPE='zh_CN.UTF-8'
" >> ~/.bashrc
source ~/.bashrc
稳妥一点 重启服务器 ,有些程序在运行中 输出可能还是有问题
近期评论