User Tools

Site Tools


tips:how-to-disable-utf-8-in-console

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tips:how-to-disable-utf-8-in-console [28.08.2011 22:54]
vergo created
tips:how-to-disable-utf-8-in-console [07.08.2012 01:37] (current)
vergo
Line 10: Line 10:
 If the result is anything else than en_US.UTF-8 then UTF-8 shouldn't be enabled and there's no point in reading the rest of this page unless generating locales is the point of interest. If the result is anything else than en_US.UTF-8 then UTF-8 shouldn't be enabled and there's no point in reading the rest of this page unless generating locales is the point of interest.
  
-Open ///etc/environment// as root (so that you can edit it) and it should by default look something like this:+Check ///etc/default/locale// and ///etc/environment// as root (so that you can edit it). One of these files will contain line similar to these, LANG is the one you are searching for:
  
 <code> <code>
-PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11" 
 LANG="en_US.UTF-8" LANG="en_US.UTF-8"
 LANGUAGE="en_FI:en" LANGUAGE="en_FI:en"
Line 22: Line 21:
 <code>LANG="en_US"</code> <code>LANG="en_US"</code>
  
-Save the changes and close the file. Also check the content of ///etc/default/locale// if it exists and make the same change. At least in Gutsy it seems to override settings from the environment file. Next it's time to generate some new locales because en_US doesn't probably exist yet. Open ///var/lib/locales/supported.d/local// and if will look like:+Save the changes and close the file. Remember to check both files!\\ 
 +\\ 
 +Next it's time to generate some new locales because en_US doesn't probably exist yet. Open ///var/lib/locales/supported.d/local// and if will look like:
  
 <code>en_US.UTF-8 UTF-8</code> <code>en_US.UTF-8 UTF-8</code>
Line 44: Line 45:
 </code> </code>
  
-local-gen will list all locales included in// /var/lib/locales/supported.d/local// and generate those if necessary. Finally just log out and back in again. UTF-8 should now be disable. That can be checked in the same way we started:+local-gen will list all locales included in ///var/lib/locales/supported.d/local// and generate those if necessary. Finally just log out and back in again. UTF-8 should now be disable. That can be checked in the same way we started:
  
 <code> <code>
Line 50: Line 51:
 en_US en_US
 </code> </code>
 +
 +===== Ubuntu 12.04 (and possibly also Debian) appendix =====
 +
 +//(status as of 5.8.2012)//\\
 +A change done in January 2012 that was introduced in Ubuntu 12.04 causes the file //.pam_environment// to be created to the user home directory usually when logging in X. The content of that file is created from ///etc/default/locale// but .UTF-8 is forced after each entry even if the original didn't contain such. This results UTF-8 getting forced even if it has been disabled in ///etc/default/locale//. The easiest way to fix this is to edit (as root) ///usr/share/language-tools/save-to-pam-env// and add the following before "exit 0" near the end of the file:
 +
 +<code>
 +sed -i -e 's:\.UTF-8::g' "$homedir/.pam_environment"
 +</code>
 +
 +Log out and back in again. Now the //.pam_environment// shouldn't anymore contain traces of UTF-8.
 +
 +Bug report in Launchpad: https://bugs.launchpad.net/ubuntu/+source/accountsservice/+bug/1033698
 +
tips/how-to-disable-utf-8-in-console.1314561273.txt.gz · Last modified: 28.08.2011 22:54 by vergo