Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#######
#
# E-scripts on locales
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/locale.e>
#           or at <http://angg.twu.net/e/locale.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




# «.locales»		(to "locales")
# «.locale-gen»		(to "locale-gen")
# «.wc-and-accents»	(to "wc-and-accents")
# «.collation»		(to "collation")



# (find-es "mail" "mutt-accents")




#####
#
# locales
# 2004aug17
#
#####


# «locales»  (to ".locales")
# (find-status   "glibc-doc")
# (find-vldifile "glibc-doc.list")
# (find-udfile   "glibc-doc/")
# (find-node "(libc)Locales")
# (find-node "(libc)Locale Categories")
# (find-node "(libc)Character Set Handling")
# (find-node "(libc)Choosing Locale" "LANG")

# (find-man "1 debconf")
# (find-man "8 dpkg-reconfigure")
# (find-man "8 locale-gen")
# (find-man "5 locale.gen")

sudo dpkg-reconfigure -fdialog debconf
sudo dpkg-reconfigure locales
# (find-man "5 locale.alias")
# (find-man "5 locale.gen")
# (find-man "8 locale-gen")
# (find-man "1 localedef")
# (find-man "7 locale")
# (find-fline "/etc/locale.alias")
# (find-fline "/etc/locale.gen")

# (find-sh "locale -a")

# (find-status   "locales")
# (find-vldifile "locales.list")
# (find-udfile   "locales/")

# (find-fline "/usr/share/i18n/locales/")
# (find-fline "/usr/share/i18n/charmaps/")
# (find-fline "/usr/share/i18n/SUPPORTED")

# (find-fline "/usr/share/i18n/locales/pt_BR")
# (find-fline "/usr/share/i18n/charmaps/UTF-8.gz")
# (find-fline "/usr/share/i18n/charmaps/IBM850.gz")
# (find-fline "/usr/share/i18n/charmaps/ISO-8859-1.gz")
# (find-fline "/usr/share/i18n/charmaps/ISO-8859-9.gz")




# (find-status   "libc6-dbg")
# (find-vldifile "libc6-dbg.list")
# (find-udfile   "libc6-dbg/")




#####
#
# locale-gen - claviola's solution
# 2005jan14
#
#####

# «locale-gen»  (to ".locale-gen")
# http://lists.debian.org/debian-user-portuguese/2002/03/msg00286.html
#*
# The message suggests this (for mutt; needs to be run as root):
echo en_US ISO-8859-1 >> /etc/locale.gen
locale-gen
cat << EOF >> /etc/environment
export LANG=en_US
export LANGUAGE=en_US
export LC_ALL=en_US
EOF

#*
# For uxterm (it said "uxterm tried to use locale en_US.UTF-8"):
echo en_US UTF-8 >> /etc/locale.gen
locale-gen

#*

# 2010jan13, incomplete:
# (find-man "8 locale-gen")
# (find-sh0 "sudo chown edrx:edrx /etc/locale.gen")
# (find-fline "/etc/" "locale.gen")
# (find-fline "/etc/locale.gen")





#####
#
# wc and accents
# 2006jul13
#
#####

# «wc-and-accents»  (to ".wc-and-accents")
# (find-es "locale" "locales")
# (find-fline "/usr/share/i18n/SUPPORTED")
# (find-fline "/usr/share/i18n/SUPPORTED" "pt_BR ISO-8859-1")
# (find-node "(recode)Top")
# (find-orgfile "2006-07-04.org" "od -t x1c")
# (find-man "1 locale")
# (find-sh "locale -a")
# (find-fline "/etc/locale.gen")
# (find-man "wc")
# (find-node "(coreutils)wc invocation")
# (find-
#*
cd /tmp/
echo 'máquina' > wctest.txt
od -t x1c wctest.txt
LANG=C     wc wctest.txt
LANG=en_US wc wctest.txt

# The results of wc should change with the locale, but they don't yet...
for i in $(locale -a); do echo $i:; LANG=$i wc wctest.txt; done

#*




#####
#
# collation
# 2007apr16
#
#####

# «collation»  (to ".collation")
# (find-sh "echo .em e/c e/l e/r e/x eev | tr ' ' '\\n' | LANG=C     sort")
# (find-sh "echo .em e/c e/l e/r e/x eev | tr ' ' '\\n' | LANG=en_US sort")
# (find-node "(libc)Collation Functions")
# (find-node "(libc)Effects of Locale")

  LANG=C     -> sort uses asciibetical order
  LANG=en_US -> sort uses an evil (lexicographical?) order -
                It orders the things above as "e/c eev e/l .em e/r e/x".

# (find-fline "/var/cache/debconf/config.dat" "Name: debian-installer/language")

dpkg-reconfigure base-config
# Ouch:
# /usr/sbin/dpkg-reconfigure: base-config is broken or not fully installed





#  Local Variables:
#  coding:               raw-text-unix
#  ee-delimiter-hash:    "\n#*\n"
#  ee-delimiter-percent: "\n%*\n"
#  ee-anchor-format:     "«%s»"
#  End: