Bug 210

Summary: encoding problem with zh_CN.UTF-8 locale
Product: Sudo Reporter: Zhang Wei <id.brep>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED INVALID    
Severity: normal    
Priority: normal    
Version: 1.6.8   
Hardware: PC   
OS: Linux   

Description Zhang Wei 2006-03-09 10:18:57 MST
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.
Comment 1 Todd C. Miller 2007-06-19 19:50:27 MDT
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
Comment 2 Todd C. Miller 2007-07-30 12:49:14 MDT
This appears to be a configuration problem.