[Bug 829314] Re: Login shell sets LC_CTYPE=UTF-8

Fred 829314 at bugs.launchpad.net
Thu Jul 26 02:05:56 UTC 2012


http://iam.richardbucker.com/tag/change-locale/

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to console-setup in Ubuntu.
https://bugs.launchpad.net/bugs/829314

Title:
  Login shell sets LC_CTYPE=UTF-8

Status in “console-setup” package in Ubuntu:
  Confirmed

Bug description:
  I'm using Ubuntu 10.04 LTS on several servers.  On all of the servers
  the login shell sets LC_CTYPE=UTF-8.  See the output below:

  Ubuntu 10.04.3 LTS

  Welcome to Ubuntu!
   * Documentation:  https://help.ubuntu.com/
  Last login: Fri Aug 19 04:15:31 2011 from localhost
  root at gains:~# locale
  locale: Cannot set LC_CTYPE to default locale: No such file or directory
  locale: Cannot set LC_ALL to default locale: No such file or directory
  LANG=en_US.utf8
  LC_CTYPE=UTF-8
  LC_NUMERIC="en_US.utf8"
  LC_TIME="en_US.utf8"
  LC_COLLATE="en_US.utf8"
  LC_MONETARY="en_US.utf8"
  LC_MESSAGES="en_US.utf8"
  LC_PAPER="en_US.utf8"
  LC_NAME="en_US.utf8"
  LC_ADDRESS="en_US.utf8"
  LC_TELEPHONE="en_US.utf8"
  LC_MEASUREMENT="en_US.utf8"
  LC_IDENTIFICATION="en_US.utf8"
  LC_ALL=
  root at gains:~# 

  A LC_CTYPE=UTF-8 value generate rather annoying messages such as
  "Cannot set LC_CTYPE to default locale: No such file or directory".

  However if I start a shell via "su -", the variable setting changes to
  LC_CTYPE="en_US.utf8".  See below.

  root at gains:~# su -
  root at gains:~# locale
  LANG=en_US.utf8
  LC_CTYPE="en_US.utf8"
  LC_NUMERIC="en_US.utf8"
  LC_TIME="en_US.utf8"
  LC_COLLATE="en_US.utf8"
  LC_MONETARY="en_US.utf8"
  LC_MESSAGES="en_US.utf8"
  LC_PAPER="en_US.utf8"
  LC_NAME="en_US.utf8"
  LC_ADDRESS="en_US.utf8"
  LC_TELEPHONE="en_US.utf8"
  LC_MEASUREMENT="en_US.utf8"
  LC_IDENTIFICATION="en_US.utf8"
  LC_ALL=

  The "su -" behavior is what I expect to be correct, since the contents
  of my "/etc/defaul/locale" file is:

  root at gains:~# cat /etc/default/locale
  LANG=en_US.utf8

  Which from my understanding should mean that all the LC_* environment
  variables are set to match LANG.

  Note this problem also manifests in bash tab completion for a non-
  privileged user, see below:

  
  Ubuntu 10.04.3 LTS

  Welcome to Ubuntu!
   * Documentation:  https://help.ubuntu.com/
  Last login: Fri Aug 19 03:28:55 2011 from localhost
  warren at gains:~$ cd /-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
  -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

  bin/        dev/        home/       lib32/      lost+found/ mnt/        proc/       sbin/       srv/        tmp/        var/        
  boot/       etc/        lib/        lib64/      media/      opt/        root/       selinux/    sys/        usr/        
  warren at gains:~$ cd /^C
  warren at gains:~$ su - warren
  Password: 
  warren at gains:~$ cd /
  bin/        dev/        home/       lib32/      lost+found/ mnt/        proc/       sbin/       srv/        tmp/        var/        
  boot/       etc/        lib/        lib64/      media/      opt/        root/       selinux/    sys/        usr/        
  warren at gains:~$ cd /^C
  warren at gains:~$ 

  After "su -" tab completion now works.

  I imagine that the work around would be to set the desired LC_CTYPE
  value in /etc/default/locale, but I'd kind of like Ubuntu
  (particularly LTS - which I use for server installs) to "just work".

  Regards,

  
  Warren.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/console-setup/+bug/829314/+subscriptions




More information about the foundations-bugs mailing list