PageRenderTime 125ms CodeModel.GetById 12ms app.highlight 94ms RepoModel.GetById 1ms app.codeStats 1ms

/Lib/locale.py

http://unladen-swallow.googlecode.com/
Python | 1743 lines | 1714 code | 13 blank | 16 comment | 17 complexity | 0d8321b48977e0f7b772af708cfb0ed2 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1""" Locale support.
   2
   3    The module provides low-level access to the C lib's locale APIs
   4    and adds high level number formatting APIs as well as a locale
   5    aliasing engine to complement these.
   6
   7    The aliasing engine includes support for many commonly used locale
   8    names and maps them to values suitable for passing to the C lib's
   9    setlocale() function. It also includes default encodings for all
  10    supported locale names.
  11
  12"""
  13
  14import sys, encodings, encodings.aliases
  15import functools
  16
  17# Try importing the _locale module.
  18#
  19# If this fails, fall back on a basic 'C' locale emulation.
  20
  21# Yuck:  LC_MESSAGES is non-standard:  can't tell whether it exists before
  22# trying the import.  So __all__ is also fiddled at the end of the file.
  23__all__ = ["getlocale", "getdefaultlocale", "getpreferredencoding", "Error",
  24           "setlocale", "resetlocale", "localeconv", "strcoll", "strxfrm",
  25           "str", "atof", "atoi", "format", "format_string", "currency",
  26           "normalize", "LC_CTYPE", "LC_COLLATE", "LC_TIME", "LC_MONETARY",
  27           "LC_NUMERIC", "LC_ALL", "CHAR_MAX"]
  28
  29try:
  30
  31    from _locale import *
  32
  33except ImportError:
  34
  35    # Locale emulation
  36
  37    CHAR_MAX = 127
  38    LC_ALL = 6
  39    LC_COLLATE = 3
  40    LC_CTYPE = 0
  41    LC_MESSAGES = 5
  42    LC_MONETARY = 4
  43    LC_NUMERIC = 1
  44    LC_TIME = 2
  45    Error = ValueError
  46
  47    def localeconv():
  48        """ localeconv() -> dict.
  49            Returns numeric and monetary locale-specific parameters.
  50        """
  51        # 'C' locale default values
  52        return {'grouping': [127],
  53                'currency_symbol': '',
  54                'n_sign_posn': 127,
  55                'p_cs_precedes': 127,
  56                'n_cs_precedes': 127,
  57                'mon_grouping': [],
  58                'n_sep_by_space': 127,
  59                'decimal_point': '.',
  60                'negative_sign': '',
  61                'positive_sign': '',
  62                'p_sep_by_space': 127,
  63                'int_curr_symbol': '',
  64                'p_sign_posn': 127,
  65                'thousands_sep': '',
  66                'mon_thousands_sep': '',
  67                'frac_digits': 127,
  68                'mon_decimal_point': '',
  69                'int_frac_digits': 127}
  70
  71    def setlocale(category, value=None):
  72        """ setlocale(integer,string=None) -> string.
  73            Activates/queries locale processing.
  74        """
  75        if value not in (None, '', 'C'):
  76            raise Error, '_locale emulation only supports "C" locale'
  77        return 'C'
  78
  79    def strcoll(a,b):
  80        """ strcoll(string,string) -> int.
  81            Compares two strings according to the locale.
  82        """
  83        return cmp(a,b)
  84
  85    def strxfrm(s):
  86        """ strxfrm(string) -> string.
  87            Returns a string that behaves for cmp locale-aware.
  88        """
  89        return s
  90
  91
  92_localeconv = localeconv
  93
  94# With this dict, you can override some items of localeconv's return value.
  95# This is useful for testing purposes.
  96_override_localeconv = {}
  97
  98@functools.wraps(_localeconv)
  99def localeconv():
 100    d = _localeconv()
 101    if _override_localeconv:
 102        d.update(_override_localeconv)
 103    return d
 104
 105
 106### Number formatting APIs
 107
 108# Author: Martin von Loewis
 109# improved by Georg Brandl
 110
 111# Iterate over grouping intervals
 112def _grouping_intervals(grouping):
 113    for interval in grouping:
 114        # if grouping is -1, we are done
 115        if interval == CHAR_MAX:
 116            return
 117        # 0: re-use last group ad infinitum
 118        if interval == 0:
 119            while True:
 120                yield last_interval
 121        yield interval
 122        last_interval = interval
 123
 124#perform the grouping from right to left
 125def _group(s, monetary=False):
 126    conv = localeconv()
 127    thousands_sep = conv[monetary and 'mon_thousands_sep' or 'thousands_sep']
 128    grouping = conv[monetary and 'mon_grouping' or 'grouping']
 129    if not grouping:
 130        return (s, 0)
 131    result = ""
 132    seps = 0
 133    if s[-1] == ' ':
 134        stripped = s.rstrip()
 135        right_spaces = s[len(stripped):]
 136        s = stripped
 137    else:
 138        right_spaces = ''
 139    left_spaces = ''
 140    groups = []
 141    for interval in _grouping_intervals(grouping):
 142        if not s or s[-1] not in "0123456789":
 143            # only non-digit characters remain (sign, spaces)
 144            left_spaces = s
 145            s = ''
 146            break
 147        groups.append(s[-interval:])
 148        s = s[:-interval]
 149    if s:
 150        groups.append(s)
 151    groups.reverse()
 152    return (
 153        left_spaces + thousands_sep.join(groups) + right_spaces,
 154        len(thousands_sep) * (len(groups) - 1)
 155    )
 156
 157# Strip a given amount of excess padding from the given string
 158def _strip_padding(s, amount):
 159    lpos = 0
 160    while amount and s[lpos] == ' ':
 161        lpos += 1
 162        amount -= 1
 163    rpos = len(s) - 1
 164    while amount and s[rpos] == ' ':
 165        rpos -= 1
 166        amount -= 1
 167    return s[lpos:rpos+1]
 168
 169def format(percent, value, grouping=False, monetary=False, *additional):
 170    """Returns the locale-aware substitution of a %? specifier
 171    (percent).
 172
 173    additional is for format strings which contain one or more
 174    '*' modifiers."""
 175    # this is only for one-percent-specifier strings and this should be checked
 176    if percent[0] != '%':
 177        raise ValueError("format() must be given exactly one %char "
 178                         "format specifier")
 179    if additional:
 180        formatted = percent % ((value,) + additional)
 181    else:
 182        formatted = percent % value
 183    # floats and decimal ints need special action!
 184    if percent[-1] in 'eEfFgG':
 185        seps = 0
 186        parts = formatted.split('.')
 187        if grouping:
 188            parts[0], seps = _group(parts[0], monetary=monetary)
 189        decimal_point = localeconv()[monetary and 'mon_decimal_point'
 190                                              or 'decimal_point']
 191        formatted = decimal_point.join(parts)
 192        if seps:
 193            formatted = _strip_padding(formatted, seps)
 194    elif percent[-1] in 'diu':
 195        seps = 0
 196        if grouping:
 197            formatted, seps = _group(formatted, monetary=monetary)
 198        if seps:
 199            formatted = _strip_padding(formatted, seps)
 200    return formatted
 201
 202import re, operator
 203_percent_re = re.compile(r'%(?:\((?P<key>.*?)\))?'
 204                         r'(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]')
 205
 206def format_string(f, val, grouping=False):
 207    """Formats a string in the same way that the % formatting would use,
 208    but takes the current locale into account.
 209    Grouping is applied if the third parameter is true."""
 210    percents = list(_percent_re.finditer(f))
 211    new_f = _percent_re.sub('%s', f)
 212
 213    if isinstance(val, tuple):
 214        new_val = list(val)
 215        i = 0
 216        for perc in percents:
 217            starcount = perc.group('modifiers').count('*')
 218            new_val[i] = format(perc.group(), new_val[i], grouping, False, *new_val[i+1:i+1+starcount])
 219            del new_val[i+1:i+1+starcount]
 220            i += (1 + starcount)
 221        val = tuple(new_val)
 222    elif operator.isMappingType(val):
 223        for perc in percents:
 224            key = perc.group("key")
 225            val[key] = format(perc.group(), val[key], grouping)
 226    else:
 227        # val is a single value
 228        val = format(percents[0].group(), val, grouping)
 229
 230    return new_f % val
 231
 232def currency(val, symbol=True, grouping=False, international=False):
 233    """Formats val according to the currency settings
 234    in the current locale."""
 235    conv = localeconv()
 236
 237    # check for illegal values
 238    digits = conv[international and 'int_frac_digits' or 'frac_digits']
 239    if digits == 127:
 240        raise ValueError("Currency formatting is not possible using "
 241                         "the 'C' locale.")
 242
 243    s = format('%%.%if' % digits, abs(val), grouping, monetary=True)
 244    # '<' and '>' are markers if the sign must be inserted between symbol and value
 245    s = '<' + s + '>'
 246
 247    if symbol:
 248        smb = conv[international and 'int_curr_symbol' or 'currency_symbol']
 249        precedes = conv[val<0 and 'n_cs_precedes' or 'p_cs_precedes']
 250        separated = conv[val<0 and 'n_sep_by_space' or 'p_sep_by_space']
 251
 252        if precedes:
 253            s = smb + (separated and ' ' or '') + s
 254        else:
 255            s = s + (separated and ' ' or '') + smb
 256
 257    sign_pos = conv[val<0 and 'n_sign_posn' or 'p_sign_posn']
 258    sign = conv[val<0 and 'negative_sign' or 'positive_sign']
 259
 260    if sign_pos == 0:
 261        s = '(' + s + ')'
 262    elif sign_pos == 1:
 263        s = sign + s
 264    elif sign_pos == 2:
 265        s = s + sign
 266    elif sign_pos == 3:
 267        s = s.replace('<', sign)
 268    elif sign_pos == 4:
 269        s = s.replace('>', sign)
 270    else:
 271        # the default if nothing specified;
 272        # this should be the most fitting sign position
 273        s = sign + s
 274
 275    return s.replace('<', '').replace('>', '')
 276
 277def str(val):
 278    """Convert float to integer, taking the locale into account."""
 279    return format("%.12g", val)
 280
 281def atof(string, func=float):
 282    "Parses a string as a float according to the locale settings."
 283    #First, get rid of the grouping
 284    ts = localeconv()['thousands_sep']
 285    if ts:
 286        string = string.replace(ts, '')
 287    #next, replace the decimal point with a dot
 288    dd = localeconv()['decimal_point']
 289    if dd:
 290        string = string.replace(dd, '.')
 291    #finally, parse the string
 292    return func(string)
 293
 294def atoi(str):
 295    "Converts a string to an integer according to the locale settings."
 296    return atof(str, int)
 297
 298def _test():
 299    setlocale(LC_ALL, "")
 300    #do grouping
 301    s1 = format("%d", 123456789,1)
 302    print s1, "is", atoi(s1)
 303    #standard formatting
 304    s1 = str(3.14)
 305    print s1, "is", atof(s1)
 306
 307### Locale name aliasing engine
 308
 309# Author: Marc-Andre Lemburg, mal@lemburg.com
 310# Various tweaks by Fredrik Lundh <fredrik@pythonware.com>
 311
 312# store away the low-level version of setlocale (it's
 313# overridden below)
 314_setlocale = setlocale
 315
 316def normalize(localename):
 317
 318    """ Returns a normalized locale code for the given locale
 319        name.
 320
 321        The returned locale code is formatted for use with
 322        setlocale().
 323
 324        If normalization fails, the original name is returned
 325        unchanged.
 326
 327        If the given encoding is not known, the function defaults to
 328        the default encoding for the locale code just like setlocale()
 329        does.
 330
 331    """
 332    # Normalize the locale name and extract the encoding
 333    fullname = localename.lower()
 334    if ':' in fullname:
 335        # ':' is sometimes used as encoding delimiter.
 336        fullname = fullname.replace(':', '.')
 337    if '.' in fullname:
 338        langname, encoding = fullname.split('.')[:2]
 339        fullname = langname + '.' + encoding
 340    else:
 341        langname = fullname
 342        encoding = ''
 343
 344    # First lookup: fullname (possibly with encoding)
 345    norm_encoding = encoding.replace('-', '')
 346    norm_encoding = norm_encoding.replace('_', '')
 347    lookup_name = langname + '.' + encoding
 348    code = locale_alias.get(lookup_name, None)
 349    if code is not None:
 350        return code
 351    #print 'first lookup failed'
 352
 353    # Second try: langname (without encoding)
 354    code = locale_alias.get(langname, None)
 355    if code is not None:
 356        #print 'langname lookup succeeded'
 357        if '.' in code:
 358            langname, defenc = code.split('.')
 359        else:
 360            langname = code
 361            defenc = ''
 362        if encoding:
 363            # Convert the encoding to a C lib compatible encoding string
 364            norm_encoding = encodings.normalize_encoding(encoding)
 365            #print 'norm encoding: %r' % norm_encoding
 366            norm_encoding = encodings.aliases.aliases.get(norm_encoding,
 367                                                          norm_encoding)
 368            #print 'aliased encoding: %r' % norm_encoding
 369            encoding = locale_encoding_alias.get(norm_encoding,
 370                                                 norm_encoding)
 371        else:
 372            encoding = defenc
 373        #print 'found encoding %r' % encoding
 374        if encoding:
 375            return langname + '.' + encoding
 376        else:
 377            return langname
 378
 379    else:
 380        return localename
 381
 382def _parse_localename(localename):
 383
 384    """ Parses the locale code for localename and returns the
 385        result as tuple (language code, encoding).
 386
 387        The localename is normalized and passed through the locale
 388        alias engine. A ValueError is raised in case the locale name
 389        cannot be parsed.
 390
 391        The language code corresponds to RFC 1766.  code and encoding
 392        can be None in case the values cannot be determined or are
 393        unknown to this implementation.
 394
 395    """
 396    code = normalize(localename)
 397    if '@' in code:
 398        # Deal with locale modifiers
 399        code, modifier = code.split('@')
 400        if modifier == 'euro' and '.' not in code:
 401            # Assume Latin-9 for @euro locales. This is bogus,
 402            # since some systems may use other encodings for these
 403            # locales. Also, we ignore other modifiers.
 404            return code, 'iso-8859-15'
 405
 406    if '.' in code:
 407        return tuple(code.split('.')[:2])
 408    elif code == 'C':
 409        return None, None
 410    raise ValueError, 'unknown locale: %s' % localename
 411
 412def _build_localename(localetuple):
 413
 414    """ Builds a locale code from the given tuple (language code,
 415        encoding).
 416
 417        No aliasing or normalizing takes place.
 418
 419    """
 420    language, encoding = localetuple
 421    if language is None:
 422        language = 'C'
 423    if encoding is None:
 424        return language
 425    else:
 426        return language + '.' + encoding
 427
 428def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
 429
 430    """ Tries to determine the default locale settings and returns
 431        them as tuple (language code, encoding).
 432
 433        According to POSIX, a program which has not called
 434        setlocale(LC_ALL, "") runs using the portable 'C' locale.
 435        Calling setlocale(LC_ALL, "") lets it use the default locale as
 436        defined by the LANG variable. Since we don't want to interfere
 437        with the current locale setting we thus emulate the behavior
 438        in the way described above.
 439
 440        To maintain compatibility with other platforms, not only the
 441        LANG variable is tested, but a list of variables given as
 442        envvars parameter. The first found to be defined will be
 443        used. envvars defaults to the search path used in GNU gettext;
 444        it must always contain the variable name 'LANG'.
 445
 446        Except for the code 'C', the language code corresponds to RFC
 447        1766.  code and encoding can be None in case the values cannot
 448        be determined.
 449
 450    """
 451
 452    try:
 453        # check if it's supported by the _locale module
 454        import _locale
 455        code, encoding = _locale._getdefaultlocale()
 456    except (ImportError, AttributeError):
 457        pass
 458    else:
 459        # make sure the code/encoding values are valid
 460        if sys.platform == "win32" and code and code[:2] == "0x":
 461            # map windows language identifier to language name
 462            code = windows_locale.get(int(code, 0))
 463        # ...add other platform-specific processing here, if
 464        # necessary...
 465        return code, encoding
 466
 467    # fall back on POSIX behaviour
 468    import os
 469    lookup = os.environ.get
 470    for variable in envvars:
 471        localename = lookup(variable,None)
 472        if localename:
 473            if variable == 'LANGUAGE':
 474                localename = localename.split(':')[0]
 475            break
 476    else:
 477        localename = 'C'
 478    return _parse_localename(localename)
 479
 480
 481def getlocale(category=LC_CTYPE):
 482
 483    """ Returns the current setting for the given locale category as
 484        tuple (language code, encoding).
 485
 486        category may be one of the LC_* value except LC_ALL. It
 487        defaults to LC_CTYPE.
 488
 489        Except for the code 'C', the language code corresponds to RFC
 490        1766.  code and encoding can be None in case the values cannot
 491        be determined.
 492
 493    """
 494    localename = _setlocale(category)
 495    if category == LC_ALL and ';' in localename:
 496        raise TypeError, 'category LC_ALL is not supported'
 497    return _parse_localename(localename)
 498
 499def setlocale(category, locale=None):
 500
 501    """ Set the locale for the given category.  The locale can be
 502        a string, a locale tuple (language code, encoding), or None.
 503
 504        Locale tuples are converted to strings the locale aliasing
 505        engine.  Locale strings are passed directly to the C lib.
 506
 507        category may be given as one of the LC_* values.
 508
 509    """
 510    if locale and type(locale) is not type(""):
 511        # convert to string
 512        locale = normalize(_build_localename(locale))
 513    return _setlocale(category, locale)
 514
 515def resetlocale(category=LC_ALL):
 516
 517    """ Sets the locale for category to the default setting.
 518
 519        The default setting is determined by calling
 520        getdefaultlocale(). category defaults to LC_ALL.
 521
 522    """
 523    _setlocale(category, _build_localename(getdefaultlocale()))
 524
 525if sys.platform in ('win32', 'darwin', 'mac'):
 526    # On Win32, this will return the ANSI code page
 527    # On the Mac, it should return the system encoding;
 528    # it might return "ascii" instead
 529    def getpreferredencoding(do_setlocale = True):
 530        """Return the charset that the user is likely using."""
 531        import _locale
 532        return _locale._getdefaultlocale()[1]
 533else:
 534    # On Unix, if CODESET is available, use that.
 535    try:
 536        CODESET
 537    except NameError:
 538        # Fall back to parsing environment variables :-(
 539        def getpreferredencoding(do_setlocale = True):
 540            """Return the charset that the user is likely using,
 541            by looking at environment variables."""
 542            return getdefaultlocale()[1]
 543    else:
 544        def getpreferredencoding(do_setlocale = True):
 545            """Return the charset that the user is likely using,
 546            according to the system configuration."""
 547            if do_setlocale:
 548                oldloc = setlocale(LC_CTYPE)
 549                try:
 550                    setlocale(LC_CTYPE, "")
 551                except Error:
 552                    pass
 553                result = nl_langinfo(CODESET)
 554                setlocale(LC_CTYPE, oldloc)
 555                return result
 556            else:
 557                return nl_langinfo(CODESET)
 558
 559
 560### Database
 561#
 562# The following data was extracted from the locale.alias file which
 563# comes with X11 and then hand edited removing the explicit encoding
 564# definitions and adding some more aliases. The file is usually
 565# available as /usr/lib/X11/locale/locale.alias.
 566#
 567
 568#
 569# The local_encoding_alias table maps lowercase encoding alias names
 570# to C locale encoding names (case-sensitive). Note that normalize()
 571# first looks up the encoding in the encodings.aliases dictionary and
 572# then applies this mapping to find the correct C lib name for the
 573# encoding.
 574#
 575locale_encoding_alias = {
 576
 577    # Mappings for non-standard encoding names used in locale names
 578    '437':                          'C',
 579    'c':                            'C',
 580    'en':                           'ISO8859-1',
 581    'jis':                          'JIS7',
 582    'jis7':                         'JIS7',
 583    'ajec':                         'eucJP',
 584
 585    # Mappings from Python codec names to C lib encoding names
 586    'ascii':                        'ISO8859-1',
 587    'latin_1':                      'ISO8859-1',
 588    'iso8859_1':                    'ISO8859-1',
 589    'iso8859_10':                   'ISO8859-10',
 590    'iso8859_11':                   'ISO8859-11',
 591    'iso8859_13':                   'ISO8859-13',
 592    'iso8859_14':                   'ISO8859-14',
 593    'iso8859_15':                   'ISO8859-15',
 594    'iso8859_2':                    'ISO8859-2',
 595    'iso8859_3':                    'ISO8859-3',
 596    'iso8859_4':                    'ISO8859-4',
 597    'iso8859_5':                    'ISO8859-5',
 598    'iso8859_6':                    'ISO8859-6',
 599    'iso8859_7':                    'ISO8859-7',
 600    'iso8859_8':                    'ISO8859-8',
 601    'iso8859_9':                    'ISO8859-9',
 602    'iso2022_jp':                   'JIS7',
 603    'shift_jis':                    'SJIS',
 604    'tactis':                       'TACTIS',
 605    'euc_jp':                       'eucJP',
 606    'euc_kr':                       'eucKR',
 607    'utf_8':                        'UTF8',
 608    'koi8_r':                       'KOI8-R',
 609    'koi8_u':                       'KOI8-U',
 610    # XXX This list is still incomplete. If you know more
 611    # mappings, please file a bug report. Thanks.
 612}
 613
 614#
 615# The locale_alias table maps lowercase alias names to C locale names
 616# (case-sensitive). Encodings are always separated from the locale
 617# name using a dot ('.'); they should only be given in case the
 618# language name is needed to interpret the given encoding alias
 619# correctly (CJK codes often have this need).
 620#
 621# Note that the normalize() function which uses this tables
 622# removes '_' and '-' characters from the encoding part of the
 623# locale name before doing the lookup. This saves a lot of
 624# space in the table.
 625#
 626# MAL 2004-12-10:
 627# Updated alias mapping to most recent locale.alias file
 628# from X.org distribution using makelocalealias.py.
 629#
 630# These are the differences compared to the old mapping (Python 2.4
 631# and older):
 632#
 633#    updated 'bg' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251'
 634#    updated 'bg_bg' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251'
 635#    updated 'bulgarian' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251'
 636#    updated 'cz' -> 'cz_CZ.ISO8859-2' to 'cs_CZ.ISO8859-2'
 637#    updated 'cz_cz' -> 'cz_CZ.ISO8859-2' to 'cs_CZ.ISO8859-2'
 638#    updated 'czech' -> 'cs_CS.ISO8859-2' to 'cs_CZ.ISO8859-2'
 639#    updated 'dutch' -> 'nl_BE.ISO8859-1' to 'nl_NL.ISO8859-1'
 640#    updated 'et' -> 'et_EE.ISO8859-4' to 'et_EE.ISO8859-15'
 641#    updated 'et_ee' -> 'et_EE.ISO8859-4' to 'et_EE.ISO8859-15'
 642#    updated 'fi' -> 'fi_FI.ISO8859-1' to 'fi_FI.ISO8859-15'
 643#    updated 'fi_fi' -> 'fi_FI.ISO8859-1' to 'fi_FI.ISO8859-15'
 644#    updated 'iw' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8'
 645#    updated 'iw_il' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8'
 646#    updated 'japanese' -> 'ja_JP.SJIS' to 'ja_JP.eucJP'
 647#    updated 'lt' -> 'lt_LT.ISO8859-4' to 'lt_LT.ISO8859-13'
 648#    updated 'lv' -> 'lv_LV.ISO8859-4' to 'lv_LV.ISO8859-13'
 649#    updated 'sl' -> 'sl_CS.ISO8859-2' to 'sl_SI.ISO8859-2'
 650#    updated 'slovene' -> 'sl_CS.ISO8859-2' to 'sl_SI.ISO8859-2'
 651#    updated 'th_th' -> 'th_TH.TACTIS' to 'th_TH.ISO8859-11'
 652#    updated 'zh_cn' -> 'zh_CN.eucCN' to 'zh_CN.gb2312'
 653#    updated 'zh_cn.big5' -> 'zh_TW.eucTW' to 'zh_TW.big5'
 654#    updated 'zh_tw' -> 'zh_TW.eucTW' to 'zh_TW.big5'
 655#
 656# MAL 2008-05-30:
 657# Updated alias mapping to most recent locale.alias file
 658# from X.org distribution using makelocalealias.py.
 659#
 660# These are the differences compared to the old mapping (Python 2.5
 661# and older):
 662#
 663#    updated 'cs_cs.iso88592' -> 'cs_CZ.ISO8859-2' to 'cs_CS.ISO8859-2'
 664#    updated 'serbocroatian' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
 665#    updated 'sh' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
 666#    updated 'sh_hr.iso88592' -> 'sh_HR.ISO8859-2' to 'hr_HR.ISO8859-2'
 667#    updated 'sh_sp' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
 668#    updated 'sh_yu' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
 669#    updated 'sp' -> 'sp_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
 670#    updated 'sp_yu' -> 'sp_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
 671#    updated 'sr' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
 672#    updated 'sr@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
 673#    updated 'sr_sp' -> 'sr_SP.ISO8859-2' to 'sr_CS.ISO8859-2'
 674#    updated 'sr_yu' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
 675#    updated 'sr_yu.cp1251@cyrillic' -> 'sr_YU.CP1251' to 'sr_CS.CP1251'
 676#    updated 'sr_yu.iso88592' -> 'sr_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
 677#    updated 'sr_yu.iso88595' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
 678#    updated 'sr_yu.iso88595@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
 679#    updated 'sr_yu.microsoftcp1251@cyrillic' -> 'sr_YU.CP1251' to 'sr_CS.CP1251'
 680#    updated 'sr_yu.utf8@cyrillic' -> 'sr_YU.UTF-8' to 'sr_CS.UTF-8'
 681#    updated 'sr_yu@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
 682
 683locale_alias = {
 684    'a3':                                   'a3_AZ.KOI8-C',
 685    'a3_az':                                'a3_AZ.KOI8-C',
 686    'a3_az.koi8c':                          'a3_AZ.KOI8-C',
 687    'af':                                   'af_ZA.ISO8859-1',
 688    'af_za':                                'af_ZA.ISO8859-1',
 689    'af_za.iso88591':                       'af_ZA.ISO8859-1',
 690    'am':                                   'am_ET.UTF-8',
 691    'am_et':                                'am_ET.UTF-8',
 692    'american':                             'en_US.ISO8859-1',
 693    'american.iso88591':                    'en_US.ISO8859-1',
 694    'ar':                                   'ar_AA.ISO8859-6',
 695    'ar_aa':                                'ar_AA.ISO8859-6',
 696    'ar_aa.iso88596':                       'ar_AA.ISO8859-6',
 697    'ar_ae':                                'ar_AE.ISO8859-6',
 698    'ar_ae.iso88596':                       'ar_AE.ISO8859-6',
 699    'ar_bh':                                'ar_BH.ISO8859-6',
 700    'ar_bh.iso88596':                       'ar_BH.ISO8859-6',
 701    'ar_dz':                                'ar_DZ.ISO8859-6',
 702    'ar_dz.iso88596':                       'ar_DZ.ISO8859-6',
 703    'ar_eg':                                'ar_EG.ISO8859-6',
 704    'ar_eg.iso88596':                       'ar_EG.ISO8859-6',
 705    'ar_iq':                                'ar_IQ.ISO8859-6',
 706    'ar_iq.iso88596':                       'ar_IQ.ISO8859-6',
 707    'ar_jo':                                'ar_JO.ISO8859-6',
 708    'ar_jo.iso88596':                       'ar_JO.ISO8859-6',
 709    'ar_kw':                                'ar_KW.ISO8859-6',
 710    'ar_kw.iso88596':                       'ar_KW.ISO8859-6',
 711    'ar_lb':                                'ar_LB.ISO8859-6',
 712    'ar_lb.iso88596':                       'ar_LB.ISO8859-6',
 713    'ar_ly':                                'ar_LY.ISO8859-6',
 714    'ar_ly.iso88596':                       'ar_LY.ISO8859-6',
 715    'ar_ma':                                'ar_MA.ISO8859-6',
 716    'ar_ma.iso88596':                       'ar_MA.ISO8859-6',
 717    'ar_om':                                'ar_OM.ISO8859-6',
 718    'ar_om.iso88596':                       'ar_OM.ISO8859-6',
 719    'ar_qa':                                'ar_QA.ISO8859-6',
 720    'ar_qa.iso88596':                       'ar_QA.ISO8859-6',
 721    'ar_sa':                                'ar_SA.ISO8859-6',
 722    'ar_sa.iso88596':                       'ar_SA.ISO8859-6',
 723    'ar_sd':                                'ar_SD.ISO8859-6',
 724    'ar_sd.iso88596':                       'ar_SD.ISO8859-6',
 725    'ar_sy':                                'ar_SY.ISO8859-6',
 726    'ar_sy.iso88596':                       'ar_SY.ISO8859-6',
 727    'ar_tn':                                'ar_TN.ISO8859-6',
 728    'ar_tn.iso88596':                       'ar_TN.ISO8859-6',
 729    'ar_ye':                                'ar_YE.ISO8859-6',
 730    'ar_ye.iso88596':                       'ar_YE.ISO8859-6',
 731    'arabic':                               'ar_AA.ISO8859-6',
 732    'arabic.iso88596':                      'ar_AA.ISO8859-6',
 733    'az':                                   'az_AZ.ISO8859-9E',
 734    'az_az':                                'az_AZ.ISO8859-9E',
 735    'az_az.iso88599e':                      'az_AZ.ISO8859-9E',
 736    'be':                                   'be_BY.CP1251',
 737    'be_by':                                'be_BY.CP1251',
 738    'be_by.cp1251':                         'be_BY.CP1251',
 739    'be_by.microsoftcp1251':                'be_BY.CP1251',
 740    'bg':                                   'bg_BG.CP1251',
 741    'bg_bg':                                'bg_BG.CP1251',
 742    'bg_bg.cp1251':                         'bg_BG.CP1251',
 743    'bg_bg.iso88595':                       'bg_BG.ISO8859-5',
 744    'bg_bg.koi8r':                          'bg_BG.KOI8-R',
 745    'bg_bg.microsoftcp1251':                'bg_BG.CP1251',
 746    'bn_in':                                'bn_IN.UTF-8',
 747    'bokmal':                               'nb_NO.ISO8859-1',
 748    'bokm\xe5l':                            'nb_NO.ISO8859-1',
 749    'br':                                   'br_FR.ISO8859-1',
 750    'br_fr':                                'br_FR.ISO8859-1',
 751    'br_fr.iso88591':                       'br_FR.ISO8859-1',
 752    'br_fr.iso885914':                      'br_FR.ISO8859-14',
 753    'br_fr.iso885915':                      'br_FR.ISO8859-15',
 754    'br_fr.iso885915@euro':                 'br_FR.ISO8859-15',
 755    'br_fr.utf8@euro':                      'br_FR.UTF-8',
 756    'br_fr@euro':                           'br_FR.ISO8859-15',
 757    'bs':                                   'bs_BA.ISO8859-2',
 758    'bs_ba':                                'bs_BA.ISO8859-2',
 759    'bs_ba.iso88592':                       'bs_BA.ISO8859-2',
 760    'bulgarian':                            'bg_BG.CP1251',
 761    'c':                                    'C',
 762    'c-french':                             'fr_CA.ISO8859-1',
 763    'c-french.iso88591':                    'fr_CA.ISO8859-1',
 764    'c.en':                                 'C',
 765    'c.iso88591':                           'en_US.ISO8859-1',
 766    'c_c':                                  'C',
 767    'c_c.c':                                'C',
 768    'ca':                                   'ca_ES.ISO8859-1',
 769    'ca_es':                                'ca_ES.ISO8859-1',
 770    'ca_es.iso88591':                       'ca_ES.ISO8859-1',
 771    'ca_es.iso885915':                      'ca_ES.ISO8859-15',
 772    'ca_es.iso885915@euro':                 'ca_ES.ISO8859-15',
 773    'ca_es.utf8@euro':                      'ca_ES.UTF-8',
 774    'ca_es@euro':                           'ca_ES.ISO8859-15',
 775    'catalan':                              'ca_ES.ISO8859-1',
 776    'cextend':                              'en_US.ISO8859-1',
 777    'cextend.en':                           'en_US.ISO8859-1',
 778    'chinese-s':                            'zh_CN.eucCN',
 779    'chinese-t':                            'zh_TW.eucTW',
 780    'croatian':                             'hr_HR.ISO8859-2',
 781    'cs':                                   'cs_CZ.ISO8859-2',
 782    'cs_cs':                                'cs_CZ.ISO8859-2',
 783    'cs_cs.iso88592':                       'cs_CS.ISO8859-2',
 784    'cs_cz':                                'cs_CZ.ISO8859-2',
 785    'cs_cz.iso88592':                       'cs_CZ.ISO8859-2',
 786    'cy':                                   'cy_GB.ISO8859-1',
 787    'cy_gb':                                'cy_GB.ISO8859-1',
 788    'cy_gb.iso88591':                       'cy_GB.ISO8859-1',
 789    'cy_gb.iso885914':                      'cy_GB.ISO8859-14',
 790    'cy_gb.iso885915':                      'cy_GB.ISO8859-15',
 791    'cy_gb@euro':                           'cy_GB.ISO8859-15',
 792    'cz':                                   'cs_CZ.ISO8859-2',
 793    'cz_cz':                                'cs_CZ.ISO8859-2',
 794    'czech':                                'cs_CZ.ISO8859-2',
 795    'da':                                   'da_DK.ISO8859-1',
 796    'da_dk':                                'da_DK.ISO8859-1',
 797    'da_dk.88591':                          'da_DK.ISO8859-1',
 798    'da_dk.885915':                         'da_DK.ISO8859-15',
 799    'da_dk.iso88591':                       'da_DK.ISO8859-1',
 800    'da_dk.iso885915':                      'da_DK.ISO8859-15',
 801    'da_dk@euro':                           'da_DK.ISO8859-15',
 802    'danish':                               'da_DK.ISO8859-1',
 803    'danish.iso88591':                      'da_DK.ISO8859-1',
 804    'dansk':                                'da_DK.ISO8859-1',
 805    'de':                                   'de_DE.ISO8859-1',
 806    'de_at':                                'de_AT.ISO8859-1',
 807    'de_at.iso88591':                       'de_AT.ISO8859-1',
 808    'de_at.iso885915':                      'de_AT.ISO8859-15',
 809    'de_at.iso885915@euro':                 'de_AT.ISO8859-15',
 810    'de_at.utf8@euro':                      'de_AT.UTF-8',
 811    'de_at@euro':                           'de_AT.ISO8859-15',
 812    'de_be':                                'de_BE.ISO8859-1',
 813    'de_be.iso88591':                       'de_BE.ISO8859-1',
 814    'de_be.iso885915':                      'de_BE.ISO8859-15',
 815    'de_be.iso885915@euro':                 'de_BE.ISO8859-15',
 816    'de_be.utf8@euro':                      'de_BE.UTF-8',
 817    'de_be@euro':                           'de_BE.ISO8859-15',
 818    'de_ch':                                'de_CH.ISO8859-1',
 819    'de_ch.iso88591':                       'de_CH.ISO8859-1',
 820    'de_ch.iso885915':                      'de_CH.ISO8859-15',
 821    'de_ch@euro':                           'de_CH.ISO8859-15',
 822    'de_de':                                'de_DE.ISO8859-1',
 823    'de_de.88591':                          'de_DE.ISO8859-1',
 824    'de_de.885915':                         'de_DE.ISO8859-15',
 825    'de_de.885915@euro':                    'de_DE.ISO8859-15',
 826    'de_de.iso88591':                       'de_DE.ISO8859-1',
 827    'de_de.iso885915':                      'de_DE.ISO8859-15',
 828    'de_de.iso885915@euro':                 'de_DE.ISO8859-15',
 829    'de_de.utf8@euro':                      'de_DE.UTF-8',
 830    'de_de@euro':                           'de_DE.ISO8859-15',
 831    'de_lu':                                'de_LU.ISO8859-1',
 832    'de_lu.iso88591':                       'de_LU.ISO8859-1',
 833    'de_lu.iso885915':                      'de_LU.ISO8859-15',
 834    'de_lu.iso885915@euro':                 'de_LU.ISO8859-15',
 835    'de_lu.utf8@euro':                      'de_LU.UTF-8',
 836    'de_lu@euro':                           'de_LU.ISO8859-15',
 837    'deutsch':                              'de_DE.ISO8859-1',
 838    'dutch':                                'nl_NL.ISO8859-1',
 839    'dutch.iso88591':                       'nl_BE.ISO8859-1',
 840    'ee':                                   'ee_EE.ISO8859-4',
 841    'ee_ee':                                'ee_EE.ISO8859-4',
 842    'ee_ee.iso88594':                       'ee_EE.ISO8859-4',
 843    'eesti':                                'et_EE.ISO8859-1',
 844    'el':                                   'el_GR.ISO8859-7',
 845    'el_gr':                                'el_GR.ISO8859-7',
 846    'el_gr.iso88597':                       'el_GR.ISO8859-7',
 847    'el_gr@euro':                           'el_GR.ISO8859-15',
 848    'en':                                   'en_US.ISO8859-1',
 849    'en.iso88591':                          'en_US.ISO8859-1',
 850    'en_au':                                'en_AU.ISO8859-1',
 851    'en_au.iso88591':                       'en_AU.ISO8859-1',
 852    'en_be':                                'en_BE.ISO8859-1',
 853    'en_be@euro':                           'en_BE.ISO8859-15',
 854    'en_bw':                                'en_BW.ISO8859-1',
 855    'en_bw.iso88591':                       'en_BW.ISO8859-1',
 856    'en_ca':                                'en_CA.ISO8859-1',
 857    'en_ca.iso88591':                       'en_CA.ISO8859-1',
 858    'en_gb':                                'en_GB.ISO8859-1',
 859    'en_gb.88591':                          'en_GB.ISO8859-1',
 860    'en_gb.iso88591':                       'en_GB.ISO8859-1',
 861    'en_gb.iso885915':                      'en_GB.ISO8859-15',
 862    'en_gb@euro':                           'en_GB.ISO8859-15',
 863    'en_hk':                                'en_HK.ISO8859-1',
 864    'en_hk.iso88591':                       'en_HK.ISO8859-1',
 865    'en_ie':                                'en_IE.ISO8859-1',
 866    'en_ie.iso88591':                       'en_IE.ISO8859-1',
 867    'en_ie.iso885915':                      'en_IE.ISO8859-15',
 868    'en_ie.iso885915@euro':                 'en_IE.ISO8859-15',
 869    'en_ie.utf8@euro':                      'en_IE.UTF-8',
 870    'en_ie@euro':                           'en_IE.ISO8859-15',
 871    'en_in':                                'en_IN.ISO8859-1',
 872    'en_nz':                                'en_NZ.ISO8859-1',
 873    'en_nz.iso88591':                       'en_NZ.ISO8859-1',
 874    'en_ph':                                'en_PH.ISO8859-1',
 875    'en_ph.iso88591':                       'en_PH.ISO8859-1',
 876    'en_sg':                                'en_SG.ISO8859-1',
 877    'en_sg.iso88591':                       'en_SG.ISO8859-1',
 878    'en_uk':                                'en_GB.ISO8859-1',
 879    'en_us':                                'en_US.ISO8859-1',
 880    'en_us.88591':                          'en_US.ISO8859-1',
 881    'en_us.885915':                         'en_US.ISO8859-15',
 882    'en_us.iso88591':                       'en_US.ISO8859-1',
 883    'en_us.iso885915':                      'en_US.ISO8859-15',
 884    'en_us.iso885915@euro':                 'en_US.ISO8859-15',
 885    'en_us@euro':                           'en_US.ISO8859-15',
 886    'en_us@euro@euro':                      'en_US.ISO8859-15',
 887    'en_za':                                'en_ZA.ISO8859-1',
 888    'en_za.88591':                          'en_ZA.ISO8859-1',
 889    'en_za.iso88591':                       'en_ZA.ISO8859-1',
 890    'en_za.iso885915':                      'en_ZA.ISO8859-15',
 891    'en_za@euro':                           'en_ZA.ISO8859-15',
 892    'en_zw':                                'en_ZW.ISO8859-1',
 893    'en_zw.iso88591':                       'en_ZW.ISO8859-1',
 894    'eng_gb':                               'en_GB.ISO8859-1',
 895    'eng_gb.8859':                          'en_GB.ISO8859-1',
 896    'english':                              'en_EN.ISO8859-1',
 897    'english.iso88591':                     'en_EN.ISO8859-1',
 898    'english_uk':                           'en_GB.ISO8859-1',
 899    'english_uk.8859':                      'en_GB.ISO8859-1',
 900    'english_united-states':                'en_US.ISO8859-1',
 901    'english_united-states.437':            'C',
 902    'english_us':                           'en_US.ISO8859-1',
 903    'english_us.8859':                      'en_US.ISO8859-1',
 904    'english_us.ascii':                     'en_US.ISO8859-1',
 905    'eo':                                   'eo_XX.ISO8859-3',
 906    'eo_eo':                                'eo_EO.ISO8859-3',
 907    'eo_eo.iso88593':                       'eo_EO.ISO8859-3',
 908    'eo_xx':                                'eo_XX.ISO8859-3',
 909    'eo_xx.iso88593':                       'eo_XX.ISO8859-3',
 910    'es':                                   'es_ES.ISO8859-1',
 911    'es_ar':                                'es_AR.ISO8859-1',
 912    'es_ar.iso88591':                       'es_AR.ISO8859-1',
 913    'es_bo':                                'es_BO.ISO8859-1',
 914    'es_bo.iso88591':                       'es_BO.ISO8859-1',
 915    'es_cl':                                'es_CL.ISO8859-1',
 916    'es_cl.iso88591':                       'es_CL.ISO8859-1',
 917    'es_co':                                'es_CO.ISO8859-1',
 918    'es_co.iso88591':                       'es_CO.ISO8859-1',
 919    'es_cr':                                'es_CR.ISO8859-1',
 920    'es_cr.iso88591':                       'es_CR.ISO8859-1',
 921    'es_do':                                'es_DO.ISO8859-1',
 922    'es_do.iso88591':                       'es_DO.ISO8859-1',
 923    'es_ec':                                'es_EC.ISO8859-1',
 924    'es_ec.iso88591':                       'es_EC.ISO8859-1',
 925    'es_es':                                'es_ES.ISO8859-1',
 926    'es_es.88591':                          'es_ES.ISO8859-1',
 927    'es_es.iso88591':                       'es_ES.ISO8859-1',
 928    'es_es.iso885915':                      'es_ES.ISO8859-15',
 929    'es_es.iso885915@euro':                 'es_ES.ISO8859-15',
 930    'es_es.utf8@euro':                      'es_ES.UTF-8',
 931    'es_es@euro':                           'es_ES.ISO8859-15',
 932    'es_gt':                                'es_GT.ISO8859-1',
 933    'es_gt.iso88591':                       'es_GT.ISO8859-1',
 934    'es_hn':                                'es_HN.ISO8859-1',
 935    'es_hn.iso88591':                       'es_HN.ISO8859-1',
 936    'es_mx':                                'es_MX.ISO8859-1',
 937    'es_mx.iso88591':                       'es_MX.ISO8859-1',
 938    'es_ni':                                'es_NI.ISO8859-1',
 939    'es_ni.iso88591':                       'es_NI.ISO8859-1',
 940    'es_pa':                                'es_PA.ISO8859-1',
 941    'es_pa.iso88591':                       'es_PA.ISO8859-1',
 942    'es_pa.iso885915':                      'es_PA.ISO8859-15',
 943    'es_pa@euro':                           'es_PA.ISO8859-15',
 944    'es_pe':                                'es_PE.ISO8859-1',
 945    'es_pe.iso88591':                       'es_PE.ISO8859-1',
 946    'es_pe.iso885915':                      'es_PE.ISO8859-15',
 947    'es_pe@euro':                           'es_PE.ISO8859-15',
 948    'es_pr':                                'es_PR.ISO8859-1',
 949    'es_pr.iso88591':                       'es_PR.ISO8859-1',
 950    'es_py':                                'es_PY.ISO8859-1',
 951    'es_py.iso88591':                       'es_PY.ISO8859-1',
 952    'es_py.iso885915':                      'es_PY.ISO8859-15',
 953    'es_py@euro':                           'es_PY.ISO8859-15',
 954    'es_sv':                                'es_SV.ISO8859-1',
 955    'es_sv.iso88591':                       'es_SV.ISO8859-1',
 956    'es_sv.iso885915':                      'es_SV.ISO8859-15',
 957    'es_sv@euro':                           'es_SV.ISO8859-15',
 958    'es_us':                                'es_US.ISO8859-1',
 959    'es_us.iso88591':                       'es_US.ISO8859-1',
 960    'es_uy':                                'es_UY.ISO8859-1',
 961    'es_uy.iso88591':                       'es_UY.ISO8859-1',
 962    'es_uy.iso885915':                      'es_UY.ISO8859-15',
 963    'es_uy@euro':                           'es_UY.ISO8859-15',
 964    'es_ve':                                'es_VE.ISO8859-1',
 965    'es_ve.iso88591':                       'es_VE.ISO8859-1',
 966    'es_ve.iso885915':                      'es_VE.ISO8859-15',
 967    'es_ve@euro':                           'es_VE.ISO8859-15',
 968    'estonian':                             'et_EE.ISO8859-1',
 969    'et':                                   'et_EE.ISO8859-15',
 970    'et_ee':                                'et_EE.ISO8859-15',
 971    'et_ee.iso88591':                       'et_EE.ISO8859-1',
 972    'et_ee.iso885913':                      'et_EE.ISO8859-13',
 973    'et_ee.iso885915':                      'et_EE.ISO8859-15',
 974    'et_ee.iso88594':                       'et_EE.ISO8859-4',
 975    'et_ee@euro':                           'et_EE.ISO8859-15',
 976    'eu':                                   'eu_ES.ISO8859-1',
 977    'eu_es':                                'eu_ES.ISO8859-1',
 978    'eu_es.iso88591':                       'eu_ES.ISO8859-1',
 979    'eu_es.iso885915':                      'eu_ES.ISO8859-15',
 980    'eu_es.iso885915@euro':                 'eu_ES.ISO8859-15',
 981    'eu_es.utf8@euro':                      'eu_ES.UTF-8',
 982    'eu_es@euro':                           'eu_ES.ISO8859-15',
 983    'fa':                                   'fa_IR.UTF-8',
 984    'fa_ir':                                'fa_IR.UTF-8',
 985    'fa_ir.isiri3342':                      'fa_IR.ISIRI-3342',
 986    'fi':                                   'fi_FI.ISO8859-15',
 987    'fi_fi':                                'fi_FI.ISO8859-15',
 988    'fi_fi.88591':                          'fi_FI.ISO8859-1',
 989    'fi_fi.iso88591':                       'fi_FI.ISO8859-1',
 990    'fi_fi.iso885915':                      'fi_FI.ISO8859-15',
 991    'fi_fi.iso885915@euro':                 'fi_FI.ISO8859-15',
 992    'fi_fi.utf8@euro':                      'fi_FI.UTF-8',
 993    'fi_fi@euro':                           'fi_FI.ISO8859-15',
 994    'finnish':                              'fi_FI.ISO8859-1',
 995    'finnish.iso88591':                     'fi_FI.ISO8859-1',
 996    'fo':                                   'fo_FO.ISO8859-1',
 997    'fo_fo':                                'fo_FO.ISO8859-1',
 998    'fo_fo.iso88591':                       'fo_FO.ISO8859-1',
 999    'fo_fo.iso885915':                      'fo_FO.ISO8859-15',
1000    'fo_fo@euro':                           'fo_FO.ISO8859-15',
1001    'fr':                                   'fr_FR.ISO8859-1',
1002    'fr_be':                                'fr_BE.ISO8859-1',
1003    'fr_be.88591':                          'fr_BE.ISO8859-1',
1004    'fr_be.iso88591':                       'fr_BE.ISO8859-1',
1005    'fr_be.iso885915':                      'fr_BE.ISO8859-15',
1006    'fr_be.iso885915@euro':                 'fr_BE.ISO8859-15',
1007    'fr_be.utf8@euro':                      'fr_BE.UTF-8',
1008    'fr_be@euro':                           'fr_BE.ISO8859-15',
1009    'fr_ca':                                'fr_CA.ISO8859-1',
1010    'fr_ca.88591':                          'fr_CA.ISO8859-1',
1011    'fr_ca.iso88591':                       'fr_CA.ISO8859-1',
1012    'fr_ca.iso885915':                      'fr_CA.ISO8859-15',
1013    'fr_ca@euro':                           'fr_CA.ISO8859-15',
1014    'fr_ch':                                'fr_CH.ISO8859-1',
1015    'fr_ch.88591':                          'fr_CH.ISO8859-1',
1016    'fr_ch.iso88591':                       'fr_CH.ISO8859-1',
1017    'fr_ch.iso885915':                      'fr_CH.ISO8859-15',
1018    'fr_ch@euro':                           'fr_CH.ISO8859-15',
1019    'fr_fr':                                'fr_FR.ISO8859-1',
1020    'fr_fr.88591':                          'fr_FR.ISO8859-1',
1021    'fr_fr.iso88591':                       'fr_FR.ISO8859-1',
1022    'fr_fr.iso885915':                      'fr_FR.ISO8859-15',
1023    'fr_fr.iso885915@euro':                 'fr_FR.ISO8859-15',
1024    'fr_fr.utf8@euro':                      'fr_FR.UTF-8',
1025    'fr_fr@euro':                           'fr_FR.ISO8859-15',
1026    'fr_lu':                                'fr_LU.ISO8859-1',
1027    'fr_lu.88591':                          'fr_LU.ISO8859-1',
1028    'fr_lu.iso88591':                       'fr_LU.ISO8859-1',
1029    'fr_lu.iso885915':                      'fr_LU.ISO8859-15',
1030    'fr_lu.iso885915@euro':                 'fr_LU.ISO8859-15',
1031    'fr_lu.utf8@euro':                      'fr_LU.UTF-8',
1032    'fr_lu@euro':                           'fr_LU.ISO8859-15',
1033    'fran\xe7ais':                          'fr_FR.ISO8859-1',
1034    'fre_fr':                               'fr_FR.ISO8859-1',
1035    'fre_fr.8859':                          'fr_FR.ISO8859-1',
1036    'french':                               'fr_FR.ISO8859-1',
1037    'french.iso88591':                      'fr_CH.ISO8859-1',
1038    'french_france':                        'fr_FR.ISO8859-1',
1039    'french_france.8859':                   'fr_FR.ISO8859-1',
1040    'ga':                                   'ga_IE.ISO8859-1',
1041    'ga_ie':                                'ga_IE.ISO8859-1',
1042    'ga_ie.iso88591':                       'ga_IE.ISO8859-1',
1043    'ga_ie.iso885914':                      'ga_IE.ISO8859-14',
1044    'ga_ie.iso885915':                      'ga_IE.ISO8859-15',
1045    'ga_ie.iso885915@euro':                 'ga_IE.ISO8859-15',
1046    'ga_ie.utf8@euro':                      'ga_IE.UTF-8',
1047    'ga_ie@euro':                           'ga_IE.ISO8859-15',
1048    'galego':                               'gl_ES.ISO8859-1',
1049    'galician':                             'gl_ES.ISO8859-1',
1050    'gd':                                   'gd_GB.ISO8859-1',
1051    'gd_gb':                                'gd_GB.ISO8859-1',
1052    'gd_gb.iso88591':                       'gd_GB.ISO8859-1',
1053    'gd_gb.iso885914':                      'gd_GB.ISO8859-14',
1054    'gd_gb.iso885915':                      'gd_GB.ISO8859-15',
1055    'gd_gb@euro':                           'gd_GB.ISO8859-15',
1056    'ger_de':                               'de_DE.ISO8859-1',
1057    'ger_de.8859':                          'de_DE.ISO8859-1',
1058    'german':                               'de_DE.ISO8859-1',
1059    'german.iso88591':                      'de_CH.ISO8859-1',
1060    'german_germany':                       'de_DE.ISO8859-1',
1061    'german_germany.8859':                  'de_DE.ISO8859-1',
1062    'gl':                                   'gl_ES.ISO8859-1',
1063    'gl_es':                                'gl_ES.ISO8859-1',
1064    'gl_es.iso88591':                       'gl_ES.ISO8859-1',
1065    'gl_es.iso885915':                      'gl_ES.ISO8859-15',
1066    'gl_es.iso885915@euro':                 'gl_ES.ISO8859-15',
1067    'gl_es.utf8@euro':                      'gl_ES.UTF-8',
1068    'gl_es@euro':                           'gl_ES.ISO8859-15',
1069    'greek':                                'el_GR.ISO8859-7',
1070    'greek.iso88597':                       'el_GR.ISO8859-7',
1071    'gu_in':                                'gu_IN.UTF-8',
1072    'gv':                                   'gv_GB.ISO8859-1',
1073    'gv_gb':                                'gv_GB.ISO8859-1',
1074    'gv_gb.iso88591':                       'gv_GB.ISO8859-1',
1075    'gv_gb.iso885914':                      'gv_GB.ISO8859-14',
1076    'gv_gb.iso885915':                      'gv_GB.ISO8859-15',
1077    'gv_gb@euro':                           'gv_GB.ISO8859-15',
1078    'he':                                   'he_IL.ISO8859-8',
1079    'he_il':                                'he_IL.ISO8859-8',
1080    'he_il.cp1255':                         'he_IL.CP1255',
1081    'he_il.iso88598':                       'he_IL.ISO8859-8',
1082    'he_il.microsoftcp1255':                'he_IL.CP1255',
1083    'hebrew':                               'iw_IL.ISO8859-8',
1084    'hebrew.iso88598':                      'iw_IL.ISO8859-8',
1085    'hi':                                   'hi_IN.ISCII-DEV',
1086    'hi_in':                                'hi_IN.ISCII-DEV',
1087    'hi_in.isciidev':                       'hi_IN.ISCII-DEV',
1088    'hr':                                   'hr_HR.ISO8859-2',
1089    'hr_hr':                                'hr_HR.ISO8859-2',
1090    'hr_hr.iso88592':                       'hr_HR.ISO8859-2',
1091    'hrvatski':                             'hr_HR.ISO8859-2',
1092    'hu':                                   'hu_HU.ISO8859-2',
1093    'hu_hu':                                'hu_HU.ISO8859-2',
1094    'hu_hu.iso88592':                       'hu_HU.ISO8859-2',
1095    'hungarian':                            'hu_HU.ISO8859-2',
1096    'icelandic':                

Large files files are truncated, but you can click here to view the full file