|
Warning: this is an htmlized version!
The original is here, 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.
# An introduction to eev can be found here:
#
# (find-eev-quick-intro)
# http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# 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")
# (find-fline "/etc/default/locale")
# (find-man "locale")
# (find-sh "apt-file search locale")
# (find-sh "apt-file search locale | grep man")
# (find-sh "apt-file search locale | grep /man")
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
locale
locale --help
locale -a
locale -m
#####
#
# locales
# 2004aug17 / 2018nov10
#
#####
# «locales» (to ".locales")
# (find-status "locales")
# (find-vldifile "locales.list")
# (find-udfile "locales/")
# (find-man "1 localedef")
# (find-man "5 locale.alias")
# (find-man "5 locale.gen")
# (find-man "7 locale")
# (find-man "8 locale-gen")
# (find-fline "/etc/locale.alias")
# (find-fline "/etc/locale.gen")
# (find-sh "locale -a")
# (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-fline "/usr/share/i18n/charmaps/")
# (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-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
<sm> I didn't find it in the changelog, but for the record:
`LC_COLLATE=C sort` is needed to ensure a case-sensitive sort
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/tmp/foo/")
rm -Rv /tmp/foo/
mkdir /tmp/foo/
cd /tmp/foo/
for i in a b c d e f g .git h i; do touch $i; done
ls
https://news.ycombinator.com/item?id=28703525 Fun with Glibc and the Ctype.h Functions (rachelbythebay.com)
https://news.ycombinator.com/item?id=34346346 Setting the TZ environment variable avoids thousands of system calls (2017) (packagecloud.io)
# Local Variables:
# coding: utf-8-unix
# End: