Bug 210 - encoding problem with zh_CN.UTF-8 locale
encoding problem with zh_CN.UTF-8 locale
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.8
PC Linux
: normal normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-09 10:18 MST by Zhang Wei
Modified: 2007-07-30 12:49 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.