Bugzilla – Bug 210
encoding problem with zh_CN.UTF-8 locale
Last modified: 2007-07-30 12:49:14 MDT
I have set the following environment variables in my ~/.bashrc and ~/.xsession: export LANG=zh_CN.UTF-8 export LC_ALL=zh_CN.UTF-8 same environment varialbes are set in ~root/.bashrc and ~root/.xsession, and the contents of /etc/environment is: $ cat /etc/environment LANGUAGE="zh_CN:zh:en_US:en" LANG=zh_CN.UTF-8 Every thing works fine when I edit utf-8 encoded files with vim or nano, either as a normal user or as root. But when I do "sudo vi filename" as a normal user, the chinese characters that I input is completely messed up, I must use the "set encoding=utf8" command to make vim work normally. And problem is even worse with "sudo nano filename", because I have no way to make nano work normally with chinese character input.
It sounds like your sudo is configured to remove the LANG and LC_* variables from the environment, please check your /etc/sudoers file. Environment handling has changed in sudo 1.6.9 (currently in beta) and those variables are explicitly passed through to the environment of the new process. If you are interested in testing the beta, you can download it from http://www.sudo.ws/sudo/beta.html
This appears to be a configuration problem.