cldr2def: Modify tool to create a "common" UTF-8 locale
authorJohn Marino <draco@marino.st>
Wed, 12 Aug 2015 23:54:31 +0000 (01:54 +0200)
committerJohn Marino <draco@marino.st>
Thu, 13 Aug 2015 00:09:08 +0000 (02:09 +0200)
commitf223f854e82cd377092965525b370baf37a1405c
treef1e171d6b805a158c69dc31deb16a7a20000c4be
parentac8ea0adbf51496526edddfa77aa17c2008b8856
cldr2def: Modify tool to create a "common" UTF-8 locale

With the switch to CLDR definitions, each locale has specific encoding.
E.g. en_US, fr_FR has latin characters, el_GR has Greek characters,
etc.  Seeing a filename written in Chinese characters while in en_US.UTF-8
will result in a bunch of "???" because the characters are illegal for
the locale's CTYPE definition.

Previously there was one shared CTYPE for all locales.  This was handy
but incorrect.  It was also not updated and became slightly bitrotted.

I am going to create a "fake" locale called "common.UTF-8".  It is the
same as en_US.UTF-8, but with an LC_CTYPE that is practically universal
in that all common character sets (and symbols) are defined.  To use it,
one can do either:
  1) Set LANG env. variable to "common.UTF-8"
  2) Set LC_CTYPE env. variable to "common.UTF-8"

e.g. "env LANG=fr_FR.UTF-8 LC_CTYPE=common.UTF-8 ls"

This commit only updates the tool.  The locale comes later.
In addition to making changes that support the "common" base, the tool
was also tweaked to favor en_US.UTF-8 as the "LOCALES+=" value.  This
should reduce a lot of the renaming churn we've been seeing on new
generations.
tools/tools/locale/Makefile
tools/tools/locale/etc/charmaps.xml
tools/tools/locale/etc/en_COMMON.UTF-8.src [new file with mode: 0644]
tools/tools/locale/tools/cldr2def.pl