PageRenderTime 67ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 1ms

/lib-python/2.7/locale.py

https://bitbucket.org/quangquach/pypy
Python | 1875 lines | 1807 code | 28 blank | 40 comment | 43 complexity | aa0fea1b8949df5df13fb904ac40d539 MD5 | raw file
  1. """ Locale support.
  2. The module provides low-level access to the C lib's locale APIs
  3. and adds high level number formatting APIs as well as a locale
  4. aliasing engine to complement these.
  5. The aliasing engine includes support for many commonly used locale
  6. names and maps them to values suitable for passing to the C lib's
  7. setlocale() function. It also includes default encodings for all
  8. supported locale names.
  9. """
  10. import sys
  11. import encodings
  12. import encodings.aliases
  13. import re
  14. import operator
  15. import functools
  16. # Try importing the _locale module.
  17. #
  18. # If this fails, fall back on a basic 'C' locale emulation.
  19. # Yuck: LC_MESSAGES is non-standard: can't tell whether it exists before
  20. # trying the import. So __all__ is also fiddled at the end of the file.
  21. __all__ = ["getlocale", "getdefaultlocale", "getpreferredencoding", "Error",
  22. "setlocale", "resetlocale", "localeconv", "strcoll", "strxfrm",
  23. "str", "atof", "atoi", "format", "format_string", "currency",
  24. "normalize", "LC_CTYPE", "LC_COLLATE", "LC_TIME", "LC_MONETARY",
  25. "LC_NUMERIC", "LC_ALL", "CHAR_MAX"]
  26. try:
  27. from _locale import *
  28. except ImportError:
  29. # Locale emulation
  30. CHAR_MAX = 127
  31. LC_ALL = 6
  32. LC_COLLATE = 3
  33. LC_CTYPE = 0
  34. LC_MESSAGES = 5
  35. LC_MONETARY = 4
  36. LC_NUMERIC = 1
  37. LC_TIME = 2
  38. Error = ValueError
  39. def localeconv():
  40. """ localeconv() -> dict.
  41. Returns numeric and monetary locale-specific parameters.
  42. """
  43. # 'C' locale default values
  44. return {'grouping': [127],
  45. 'currency_symbol': '',
  46. 'n_sign_posn': 127,
  47. 'p_cs_precedes': 127,
  48. 'n_cs_precedes': 127,
  49. 'mon_grouping': [],
  50. 'n_sep_by_space': 127,
  51. 'decimal_point': '.',
  52. 'negative_sign': '',
  53. 'positive_sign': '',
  54. 'p_sep_by_space': 127,
  55. 'int_curr_symbol': '',
  56. 'p_sign_posn': 127,
  57. 'thousands_sep': '',
  58. 'mon_thousands_sep': '',
  59. 'frac_digits': 127,
  60. 'mon_decimal_point': '',
  61. 'int_frac_digits': 127}
  62. def setlocale(category, value=None):
  63. """ setlocale(integer,string=None) -> string.
  64. Activates/queries locale processing.
  65. """
  66. if value not in (None, '', 'C'):
  67. raise Error, '_locale emulation only supports "C" locale'
  68. return 'C'
  69. def strcoll(a,b):
  70. """ strcoll(string,string) -> int.
  71. Compares two strings according to the locale.
  72. """
  73. return cmp(a,b)
  74. def strxfrm(s):
  75. """ strxfrm(string) -> string.
  76. Returns a string that behaves for cmp locale-aware.
  77. """
  78. return s
  79. _localeconv = localeconv
  80. # With this dict, you can override some items of localeconv's return value.
  81. # This is useful for testing purposes.
  82. _override_localeconv = {}
  83. @functools.wraps(_localeconv)
  84. def localeconv():
  85. d = _localeconv()
  86. if _override_localeconv:
  87. d.update(_override_localeconv)
  88. return d
  89. ### Number formatting APIs
  90. # Author: Martin von Loewis
  91. # improved by Georg Brandl
  92. # Iterate over grouping intervals
  93. def _grouping_intervals(grouping):
  94. last_interval = None
  95. for interval in grouping:
  96. # if grouping is -1, we are done
  97. if interval == CHAR_MAX:
  98. return
  99. # 0: re-use last group ad infinitum
  100. if interval == 0:
  101. if last_interval is None:
  102. raise ValueError("invalid grouping")
  103. while True:
  104. yield last_interval
  105. yield interval
  106. last_interval = interval
  107. #perform the grouping from right to left
  108. def _group(s, monetary=False):
  109. conv = localeconv()
  110. thousands_sep = conv[monetary and 'mon_thousands_sep' or 'thousands_sep']
  111. grouping = conv[monetary and 'mon_grouping' or 'grouping']
  112. if not grouping:
  113. return (s, 0)
  114. if s[-1] == ' ':
  115. stripped = s.rstrip()
  116. right_spaces = s[len(stripped):]
  117. s = stripped
  118. else:
  119. right_spaces = ''
  120. left_spaces = ''
  121. groups = []
  122. for interval in _grouping_intervals(grouping):
  123. if not s or s[-1] not in "0123456789":
  124. # only non-digit characters remain (sign, spaces)
  125. left_spaces = s
  126. s = ''
  127. break
  128. groups.append(s[-interval:])
  129. s = s[:-interval]
  130. if s:
  131. groups.append(s)
  132. groups.reverse()
  133. return (
  134. left_spaces + thousands_sep.join(groups) + right_spaces,
  135. len(thousands_sep) * (len(groups) - 1)
  136. )
  137. # Strip a given amount of excess padding from the given string
  138. def _strip_padding(s, amount):
  139. lpos = 0
  140. while amount and s[lpos] == ' ':
  141. lpos += 1
  142. amount -= 1
  143. rpos = len(s) - 1
  144. while amount and s[rpos] == ' ':
  145. rpos -= 1
  146. amount -= 1
  147. return s[lpos:rpos+1]
  148. _percent_re = re.compile(r'%(?:\((?P<key>.*?)\))?'
  149. r'(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]')
  150. def format(percent, value, grouping=False, monetary=False, *additional):
  151. """Returns the locale-aware substitution of a %? specifier
  152. (percent).
  153. additional is for format strings which contain one or more
  154. '*' modifiers."""
  155. # this is only for one-percent-specifier strings and this should be checked
  156. match = _percent_re.match(percent)
  157. if not match or len(match.group())!= len(percent):
  158. raise ValueError(("format() must be given exactly one %%char "
  159. "format specifier, %s not valid") % repr(percent))
  160. return _format(percent, value, grouping, monetary, *additional)
  161. def _format(percent, value, grouping=False, monetary=False, *additional):
  162. if additional:
  163. formatted = percent % ((value,) + additional)
  164. else:
  165. formatted = percent % value
  166. # floats and decimal ints need special action!
  167. if percent[-1] in 'eEfFgG':
  168. seps = 0
  169. parts = formatted.split('.')
  170. if grouping:
  171. parts[0], seps = _group(parts[0], monetary=monetary)
  172. decimal_point = localeconv()[monetary and 'mon_decimal_point'
  173. or 'decimal_point']
  174. formatted = decimal_point.join(parts)
  175. if seps:
  176. formatted = _strip_padding(formatted, seps)
  177. elif percent[-1] in 'diu':
  178. seps = 0
  179. if grouping:
  180. formatted, seps = _group(formatted, monetary=monetary)
  181. if seps:
  182. formatted = _strip_padding(formatted, seps)
  183. return formatted
  184. def format_string(f, val, grouping=False):
  185. """Formats a string in the same way that the % formatting would use,
  186. but takes the current locale into account.
  187. Grouping is applied if the third parameter is true."""
  188. percents = list(_percent_re.finditer(f))
  189. new_f = _percent_re.sub('%s', f)
  190. if operator.isMappingType(val):
  191. new_val = []
  192. for perc in percents:
  193. if perc.group()[-1]=='%':
  194. new_val.append('%')
  195. else:
  196. new_val.append(format(perc.group(), val, grouping))
  197. else:
  198. if not isinstance(val, tuple):
  199. val = (val,)
  200. new_val = []
  201. i = 0
  202. for perc in percents:
  203. if perc.group()[-1]=='%':
  204. new_val.append('%')
  205. else:
  206. starcount = perc.group('modifiers').count('*')
  207. new_val.append(_format(perc.group(),
  208. val[i],
  209. grouping,
  210. False,
  211. *val[i+1:i+1+starcount]))
  212. i += (1 + starcount)
  213. val = tuple(new_val)
  214. return new_f % val
  215. def currency(val, symbol=True, grouping=False, international=False):
  216. """Formats val according to the currency settings
  217. in the current locale."""
  218. conv = localeconv()
  219. # check for illegal values
  220. digits = conv[international and 'int_frac_digits' or 'frac_digits']
  221. if digits == 127:
  222. raise ValueError("Currency formatting is not possible using "
  223. "the 'C' locale.")
  224. s = format('%%.%if' % digits, abs(val), grouping, monetary=True)
  225. # '<' and '>' are markers if the sign must be inserted between symbol and value
  226. s = '<' + s + '>'
  227. if symbol:
  228. smb = conv[international and 'int_curr_symbol' or 'currency_symbol']
  229. precedes = conv[val<0 and 'n_cs_precedes' or 'p_cs_precedes']
  230. separated = conv[val<0 and 'n_sep_by_space' or 'p_sep_by_space']
  231. if precedes:
  232. s = smb + (separated and ' ' or '') + s
  233. else:
  234. s = s + (separated and ' ' or '') + smb
  235. sign_pos = conv[val<0 and 'n_sign_posn' or 'p_sign_posn']
  236. sign = conv[val<0 and 'negative_sign' or 'positive_sign']
  237. if sign_pos == 0:
  238. s = '(' + s + ')'
  239. elif sign_pos == 1:
  240. s = sign + s
  241. elif sign_pos == 2:
  242. s = s + sign
  243. elif sign_pos == 3:
  244. s = s.replace('<', sign)
  245. elif sign_pos == 4:
  246. s = s.replace('>', sign)
  247. else:
  248. # the default if nothing specified;
  249. # this should be the most fitting sign position
  250. s = sign + s
  251. return s.replace('<', '').replace('>', '')
  252. def str(val):
  253. """Convert float to integer, taking the locale into account."""
  254. return format("%.12g", val)
  255. def atof(string, func=float):
  256. "Parses a string as a float according to the locale settings."
  257. #First, get rid of the grouping
  258. ts = localeconv()['thousands_sep']
  259. if ts:
  260. string = string.replace(ts, '')
  261. #next, replace the decimal point with a dot
  262. dd = localeconv()['decimal_point']
  263. if dd:
  264. string = string.replace(dd, '.')
  265. #finally, parse the string
  266. return func(string)
  267. def atoi(str):
  268. "Converts a string to an integer according to the locale settings."
  269. return atof(str, int)
  270. def _test():
  271. setlocale(LC_ALL, "")
  272. #do grouping
  273. s1 = format("%d", 123456789,1)
  274. print s1, "is", atoi(s1)
  275. #standard formatting
  276. s1 = str(3.14)
  277. print s1, "is", atof(s1)
  278. ### Locale name aliasing engine
  279. # Author: Marc-Andre Lemburg, mal@lemburg.com
  280. # Various tweaks by Fredrik Lundh <fredrik@pythonware.com>
  281. # store away the low-level version of setlocale (it's
  282. # overridden below)
  283. _setlocale = setlocale
  284. # Avoid relying on the locale-dependent .lower() method
  285. # (see issue #1813).
  286. _ascii_lower_map = ''.join(
  287. chr(x + 32 if x >= ord('A') and x <= ord('Z') else x)
  288. for x in range(256)
  289. )
  290. def normalize(localename):
  291. """ Returns a normalized locale code for the given locale
  292. name.
  293. The returned locale code is formatted for use with
  294. setlocale().
  295. If normalization fails, the original name is returned
  296. unchanged.
  297. If the given encoding is not known, the function defaults to
  298. the default encoding for the locale code just like setlocale()
  299. does.
  300. """
  301. # Normalize the locale name and extract the encoding
  302. if isinstance(localename, unicode):
  303. localename = localename.encode('ascii')
  304. fullname = localename.translate(_ascii_lower_map)
  305. if ':' in fullname:
  306. # ':' is sometimes used as encoding delimiter.
  307. fullname = fullname.replace(':', '.')
  308. if '.' in fullname:
  309. langname, encoding = fullname.split('.')[:2]
  310. fullname = langname + '.' + encoding
  311. else:
  312. langname = fullname
  313. encoding = ''
  314. # First lookup: fullname (possibly with encoding)
  315. norm_encoding = encoding.replace('-', '')
  316. norm_encoding = norm_encoding.replace('_', '')
  317. lookup_name = langname + '.' + encoding
  318. code = locale_alias.get(lookup_name, None)
  319. if code is not None:
  320. return code
  321. #print 'first lookup failed'
  322. # Second try: langname (without encoding)
  323. code = locale_alias.get(langname, None)
  324. if code is not None:
  325. #print 'langname lookup succeeded'
  326. if '.' in code:
  327. langname, defenc = code.split('.')
  328. else:
  329. langname = code
  330. defenc = ''
  331. if encoding:
  332. # Convert the encoding to a C lib compatible encoding string
  333. norm_encoding = encodings.normalize_encoding(encoding)
  334. #print 'norm encoding: %r' % norm_encoding
  335. norm_encoding = encodings.aliases.aliases.get(norm_encoding,
  336. norm_encoding)
  337. #print 'aliased encoding: %r' % norm_encoding
  338. encoding = locale_encoding_alias.get(norm_encoding,
  339. norm_encoding)
  340. else:
  341. encoding = defenc
  342. #print 'found encoding %r' % encoding
  343. if encoding:
  344. return langname + '.' + encoding
  345. else:
  346. return langname
  347. else:
  348. return localename
  349. def _parse_localename(localename):
  350. """ Parses the locale code for localename and returns the
  351. result as tuple (language code, encoding).
  352. The localename is normalized and passed through the locale
  353. alias engine. A ValueError is raised in case the locale name
  354. cannot be parsed.
  355. The language code corresponds to RFC 1766. code and encoding
  356. can be None in case the values cannot be determined or are
  357. unknown to this implementation.
  358. """
  359. code = normalize(localename)
  360. if '@' in code:
  361. # Deal with locale modifiers
  362. code, modifier = code.split('@')
  363. if modifier == 'euro' and '.' not in code:
  364. # Assume Latin-9 for @euro locales. This is bogus,
  365. # since some systems may use other encodings for these
  366. # locales. Also, we ignore other modifiers.
  367. return code, 'iso-8859-15'
  368. if '.' in code:
  369. return tuple(code.split('.')[:2])
  370. elif code == 'C':
  371. return None, None
  372. raise ValueError, 'unknown locale: %s' % localename
  373. def _build_localename(localetuple):
  374. """ Builds a locale code from the given tuple (language code,
  375. encoding).
  376. No aliasing or normalizing takes place.
  377. """
  378. language, encoding = localetuple
  379. if language is None:
  380. language = 'C'
  381. if encoding is None:
  382. return language
  383. else:
  384. return language + '.' + encoding
  385. def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
  386. """ Tries to determine the default locale settings and returns
  387. them as tuple (language code, encoding).
  388. According to POSIX, a program which has not called
  389. setlocale(LC_ALL, "") runs using the portable 'C' locale.
  390. Calling setlocale(LC_ALL, "") lets it use the default locale as
  391. defined by the LANG variable. Since we don't want to interfere
  392. with the current locale setting we thus emulate the behavior
  393. in the way described above.
  394. To maintain compatibility with other platforms, not only the
  395. LANG variable is tested, but a list of variables given as
  396. envvars parameter. The first found to be defined will be
  397. used. envvars defaults to the search path used in GNU gettext;
  398. it must always contain the variable name 'LANG'.
  399. Except for the code 'C', the language code corresponds to RFC
  400. 1766. code and encoding can be None in case the values cannot
  401. be determined.
  402. """
  403. try:
  404. # check if it's supported by the _locale module
  405. import _locale
  406. code, encoding = _locale._getdefaultlocale()
  407. except (ImportError, AttributeError):
  408. pass
  409. else:
  410. # make sure the code/encoding values are valid
  411. if sys.platform == "win32" and code and code[:2] == "0x":
  412. # map windows language identifier to language name
  413. code = windows_locale.get(int(code, 0))
  414. # ...add other platform-specific processing here, if
  415. # necessary...
  416. return code, encoding
  417. # fall back on POSIX behaviour
  418. import os
  419. lookup = os.environ.get
  420. for variable in envvars:
  421. localename = lookup(variable,None)
  422. if localename:
  423. if variable == 'LANGUAGE':
  424. localename = localename.split(':')[0]
  425. break
  426. else:
  427. localename = 'C'
  428. return _parse_localename(localename)
  429. def getlocale(category=LC_CTYPE):
  430. """ Returns the current setting for the given locale category as
  431. tuple (language code, encoding).
  432. category may be one of the LC_* value except LC_ALL. It
  433. defaults to LC_CTYPE.
  434. Except for the code 'C', the language code corresponds to RFC
  435. 1766. code and encoding can be None in case the values cannot
  436. be determined.
  437. """
  438. localename = _setlocale(category)
  439. if category == LC_ALL and ';' in localename:
  440. raise TypeError, 'category LC_ALL is not supported'
  441. return _parse_localename(localename)
  442. def setlocale(category, locale=None):
  443. """ Set the locale for the given category. The locale can be
  444. a string, an iterable of two strings (language code and encoding),
  445. or None.
  446. Iterables are converted to strings using the locale aliasing
  447. engine. Locale strings are passed directly to the C lib.
  448. category may be given as one of the LC_* values.
  449. """
  450. if locale and type(locale) is not type(""):
  451. # convert to string
  452. locale = normalize(_build_localename(locale))
  453. return _setlocale(category, locale)
  454. def resetlocale(category=LC_ALL):
  455. """ Sets the locale for category to the default setting.
  456. The default setting is determined by calling
  457. getdefaultlocale(). category defaults to LC_ALL.
  458. """
  459. _setlocale(category, _build_localename(getdefaultlocale()))
  460. if sys.platform.startswith("win"):
  461. # On Win32, this will return the ANSI code page
  462. def getpreferredencoding(do_setlocale = True):
  463. """Return the charset that the user is likely using."""
  464. import _locale
  465. return _locale._getdefaultlocale()[1]
  466. else:
  467. # On Unix, if CODESET is available, use that.
  468. try:
  469. CODESET
  470. except NameError:
  471. # Fall back to parsing environment variables :-(
  472. def getpreferredencoding(do_setlocale = True):
  473. """Return the charset that the user is likely using,
  474. by looking at environment variables."""
  475. return getdefaultlocale()[1]
  476. else:
  477. def getpreferredencoding(do_setlocale = True):
  478. """Return the charset that the user is likely using,
  479. according to the system configuration."""
  480. if do_setlocale:
  481. oldloc = setlocale(LC_CTYPE)
  482. try:
  483. setlocale(LC_CTYPE, "")
  484. except Error:
  485. pass
  486. result = nl_langinfo(CODESET)
  487. setlocale(LC_CTYPE, oldloc)
  488. return result
  489. else:
  490. return nl_langinfo(CODESET)
  491. ### Database
  492. #
  493. # The following data was extracted from the locale.alias file which
  494. # comes with X11 and then hand edited removing the explicit encoding
  495. # definitions and adding some more aliases. The file is usually
  496. # available as /usr/lib/X11/locale/locale.alias.
  497. #
  498. #
  499. # The local_encoding_alias table maps lowercase encoding alias names
  500. # to C locale encoding names (case-sensitive). Note that normalize()
  501. # first looks up the encoding in the encodings.aliases dictionary and
  502. # then applies this mapping to find the correct C lib name for the
  503. # encoding.
  504. #
  505. locale_encoding_alias = {
  506. # Mappings for non-standard encoding names used in locale names
  507. '437': 'C',
  508. 'c': 'C',
  509. 'en': 'ISO8859-1',
  510. 'jis': 'JIS7',
  511. 'jis7': 'JIS7',
  512. 'ajec': 'eucJP',
  513. # Mappings from Python codec names to C lib encoding names
  514. 'ascii': 'ISO8859-1',
  515. 'latin_1': 'ISO8859-1',
  516. 'iso8859_1': 'ISO8859-1',
  517. 'iso8859_10': 'ISO8859-10',
  518. 'iso8859_11': 'ISO8859-11',
  519. 'iso8859_13': 'ISO8859-13',
  520. 'iso8859_14': 'ISO8859-14',
  521. 'iso8859_15': 'ISO8859-15',
  522. 'iso8859_16': 'ISO8859-16',
  523. 'iso8859_2': 'ISO8859-2',
  524. 'iso8859_3': 'ISO8859-3',
  525. 'iso8859_4': 'ISO8859-4',
  526. 'iso8859_5': 'ISO8859-5',
  527. 'iso8859_6': 'ISO8859-6',
  528. 'iso8859_7': 'ISO8859-7',
  529. 'iso8859_8': 'ISO8859-8',
  530. 'iso8859_9': 'ISO8859-9',
  531. 'iso2022_jp': 'JIS7',
  532. 'shift_jis': 'SJIS',
  533. 'tactis': 'TACTIS',
  534. 'euc_jp': 'eucJP',
  535. 'euc_kr': 'eucKR',
  536. 'utf_8': 'UTF-8',
  537. 'koi8_r': 'KOI8-R',
  538. 'koi8_u': 'KOI8-U',
  539. # XXX This list is still incomplete. If you know more
  540. # mappings, please file a bug report. Thanks.
  541. }
  542. #
  543. # The locale_alias table maps lowercase alias names to C locale names
  544. # (case-sensitive). Encodings are always separated from the locale
  545. # name using a dot ('.'); they should only be given in case the
  546. # language name is needed to interpret the given encoding alias
  547. # correctly (CJK codes often have this need).
  548. #
  549. # Note that the normalize() function which uses this tables
  550. # removes '_' and '-' characters from the encoding part of the
  551. # locale name before doing the lookup. This saves a lot of
  552. # space in the table.
  553. #
  554. # MAL 2004-12-10:
  555. # Updated alias mapping to most recent locale.alias file
  556. # from X.org distribution using makelocalealias.py.
  557. #
  558. # These are the differences compared to the old mapping (Python 2.4
  559. # and older):
  560. #
  561. # updated 'bg' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251'
  562. # updated 'bg_bg' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251'
  563. # updated 'bulgarian' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251'
  564. # updated 'cz' -> 'cz_CZ.ISO8859-2' to 'cs_CZ.ISO8859-2'
  565. # updated 'cz_cz' -> 'cz_CZ.ISO8859-2' to 'cs_CZ.ISO8859-2'
  566. # updated 'czech' -> 'cs_CS.ISO8859-2' to 'cs_CZ.ISO8859-2'
  567. # updated 'dutch' -> 'nl_BE.ISO8859-1' to 'nl_NL.ISO8859-1'
  568. # updated 'et' -> 'et_EE.ISO8859-4' to 'et_EE.ISO8859-15'
  569. # updated 'et_ee' -> 'et_EE.ISO8859-4' to 'et_EE.ISO8859-15'
  570. # updated 'fi' -> 'fi_FI.ISO8859-1' to 'fi_FI.ISO8859-15'
  571. # updated 'fi_fi' -> 'fi_FI.ISO8859-1' to 'fi_FI.ISO8859-15'
  572. # updated 'iw' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8'
  573. # updated 'iw_il' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8'
  574. # updated 'japanese' -> 'ja_JP.SJIS' to 'ja_JP.eucJP'
  575. # updated 'lt' -> 'lt_LT.ISO8859-4' to 'lt_LT.ISO8859-13'
  576. # updated 'lv' -> 'lv_LV.ISO8859-4' to 'lv_LV.ISO8859-13'
  577. # updated 'sl' -> 'sl_CS.ISO8859-2' to 'sl_SI.ISO8859-2'
  578. # updated 'slovene' -> 'sl_CS.ISO8859-2' to 'sl_SI.ISO8859-2'
  579. # updated 'th_th' -> 'th_TH.TACTIS' to 'th_TH.ISO8859-11'
  580. # updated 'zh_cn' -> 'zh_CN.eucCN' to 'zh_CN.gb2312'
  581. # updated 'zh_cn.big5' -> 'zh_TW.eucTW' to 'zh_TW.big5'
  582. # updated 'zh_tw' -> 'zh_TW.eucTW' to 'zh_TW.big5'
  583. #
  584. # MAL 2008-05-30:
  585. # Updated alias mapping to most recent locale.alias file
  586. # from X.org distribution using makelocalealias.py.
  587. #
  588. # These are the differences compared to the old mapping (Python 2.5
  589. # and older):
  590. #
  591. # updated 'cs_cs.iso88592' -> 'cs_CZ.ISO8859-2' to 'cs_CS.ISO8859-2'
  592. # updated 'serbocroatian' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
  593. # updated 'sh' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
  594. # updated 'sh_hr.iso88592' -> 'sh_HR.ISO8859-2' to 'hr_HR.ISO8859-2'
  595. # updated 'sh_sp' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
  596. # updated 'sh_yu' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
  597. # updated 'sp' -> 'sp_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
  598. # updated 'sp_yu' -> 'sp_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
  599. # updated 'sr' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
  600. # updated 'sr@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
  601. # updated 'sr_sp' -> 'sr_SP.ISO8859-2' to 'sr_CS.ISO8859-2'
  602. # updated 'sr_yu' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
  603. # updated 'sr_yu.cp1251@cyrillic' -> 'sr_YU.CP1251' to 'sr_CS.CP1251'
  604. # updated 'sr_yu.iso88592' -> 'sr_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
  605. # updated 'sr_yu.iso88595' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
  606. # updated 'sr_yu.iso88595@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
  607. # updated 'sr_yu.microsoftcp1251@cyrillic' -> 'sr_YU.CP1251' to 'sr_CS.CP1251'
  608. # updated 'sr_yu.utf8@cyrillic' -> 'sr_YU.UTF-8' to 'sr_CS.UTF-8'
  609. # updated 'sr_yu@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
  610. #
  611. # AP 2010-04-12:
  612. # Updated alias mapping to most recent locale.alias file
  613. # from X.org distribution using makelocalealias.py.
  614. #
  615. # These are the differences compared to the old mapping (Python 2.6.5
  616. # and older):
  617. #
  618. # updated 'ru' -> 'ru_RU.ISO8859-5' to 'ru_RU.UTF-8'
  619. # updated 'ru_ru' -> 'ru_RU.ISO8859-5' to 'ru_RU.UTF-8'
  620. # updated 'serbocroatian' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
  621. # updated 'sh' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
  622. # updated 'sh_yu' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
  623. # updated 'sr' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
  624. # updated 'sr@cyrillic' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
  625. # updated 'sr@latn' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
  626. # updated 'sr_cs.utf8@latn' -> 'sr_CS.UTF-8' to 'sr_RS.UTF-8@latin'
  627. # updated 'sr_cs@latn' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
  628. # updated 'sr_yu' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8@latin'
  629. # updated 'sr_yu.utf8@cyrillic' -> 'sr_CS.UTF-8' to 'sr_RS.UTF-8'
  630. # updated 'sr_yu@cyrillic' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
  631. #
  632. locale_alias = {
  633. 'a3': 'a3_AZ.KOI8-C',
  634. 'a3_az': 'a3_AZ.KOI8-C',
  635. 'a3_az.koi8c': 'a3_AZ.KOI8-C',
  636. 'af': 'af_ZA.ISO8859-1',
  637. 'af_za': 'af_ZA.ISO8859-1',
  638. 'af_za.iso88591': 'af_ZA.ISO8859-1',
  639. 'am': 'am_ET.UTF-8',
  640. 'am_et': 'am_ET.UTF-8',
  641. 'american': 'en_US.ISO8859-1',
  642. 'american.iso88591': 'en_US.ISO8859-1',
  643. 'ar': 'ar_AA.ISO8859-6',
  644. 'ar_aa': 'ar_AA.ISO8859-6',
  645. 'ar_aa.iso88596': 'ar_AA.ISO8859-6',
  646. 'ar_ae': 'ar_AE.ISO8859-6',
  647. 'ar_ae.iso88596': 'ar_AE.ISO8859-6',
  648. 'ar_bh': 'ar_BH.ISO8859-6',
  649. 'ar_bh.iso88596': 'ar_BH.ISO8859-6',
  650. 'ar_dz': 'ar_DZ.ISO8859-6',
  651. 'ar_dz.iso88596': 'ar_DZ.ISO8859-6',
  652. 'ar_eg': 'ar_EG.ISO8859-6',
  653. 'ar_eg.iso88596': 'ar_EG.ISO8859-6',
  654. 'ar_iq': 'ar_IQ.ISO8859-6',
  655. 'ar_iq.iso88596': 'ar_IQ.ISO8859-6',
  656. 'ar_jo': 'ar_JO.ISO8859-6',
  657. 'ar_jo.iso88596': 'ar_JO.ISO8859-6',
  658. 'ar_kw': 'ar_KW.ISO8859-6',
  659. 'ar_kw.iso88596': 'ar_KW.ISO8859-6',
  660. 'ar_lb': 'ar_LB.ISO8859-6',
  661. 'ar_lb.iso88596': 'ar_LB.ISO8859-6',
  662. 'ar_ly': 'ar_LY.ISO8859-6',
  663. 'ar_ly.iso88596': 'ar_LY.ISO8859-6',
  664. 'ar_ma': 'ar_MA.ISO8859-6',
  665. 'ar_ma.iso88596': 'ar_MA.ISO8859-6',
  666. 'ar_om': 'ar_OM.ISO8859-6',
  667. 'ar_om.iso88596': 'ar_OM.ISO8859-6',
  668. 'ar_qa': 'ar_QA.ISO8859-6',
  669. 'ar_qa.iso88596': 'ar_QA.ISO8859-6',
  670. 'ar_sa': 'ar_SA.ISO8859-6',
  671. 'ar_sa.iso88596': 'ar_SA.ISO8859-6',
  672. 'ar_sd': 'ar_SD.ISO8859-6',
  673. 'ar_sd.iso88596': 'ar_SD.ISO8859-6',
  674. 'ar_sy': 'ar_SY.ISO8859-6',
  675. 'ar_sy.iso88596': 'ar_SY.ISO8859-6',
  676. 'ar_tn': 'ar_TN.ISO8859-6',
  677. 'ar_tn.iso88596': 'ar_TN.ISO8859-6',
  678. 'ar_ye': 'ar_YE.ISO8859-6',
  679. 'ar_ye.iso88596': 'ar_YE.ISO8859-6',
  680. 'arabic': 'ar_AA.ISO8859-6',
  681. 'arabic.iso88596': 'ar_AA.ISO8859-6',
  682. 'as': 'as_IN.UTF-8',
  683. 'az': 'az_AZ.ISO8859-9E',
  684. 'az_az': 'az_AZ.ISO8859-9E',
  685. 'az_az.iso88599e': 'az_AZ.ISO8859-9E',
  686. 'be': 'be_BY.CP1251',
  687. 'be@latin': 'be_BY.UTF-8@latin',
  688. 'be_by': 'be_BY.CP1251',
  689. 'be_by.cp1251': 'be_BY.CP1251',
  690. 'be_by.microsoftcp1251': 'be_BY.CP1251',
  691. 'be_by.utf8@latin': 'be_BY.UTF-8@latin',
  692. 'be_by@latin': 'be_BY.UTF-8@latin',
  693. 'bg': 'bg_BG.CP1251',
  694. 'bg_bg': 'bg_BG.CP1251',
  695. 'bg_bg.cp1251': 'bg_BG.CP1251',
  696. 'bg_bg.iso88595': 'bg_BG.ISO8859-5',
  697. 'bg_bg.koi8r': 'bg_BG.KOI8-R',
  698. 'bg_bg.microsoftcp1251': 'bg_BG.CP1251',
  699. 'bn_in': 'bn_IN.UTF-8',
  700. 'bokmal': 'nb_NO.ISO8859-1',
  701. 'bokm\xe5l': 'nb_NO.ISO8859-1',
  702. 'br': 'br_FR.ISO8859-1',
  703. 'br_fr': 'br_FR.ISO8859-1',
  704. 'br_fr.iso88591': 'br_FR.ISO8859-1',
  705. 'br_fr.iso885914': 'br_FR.ISO8859-14',
  706. 'br_fr.iso885915': 'br_FR.ISO8859-15',
  707. 'br_fr.iso885915@euro': 'br_FR.ISO8859-15',
  708. 'br_fr.utf8@euro': 'br_FR.UTF-8',
  709. 'br_fr@euro': 'br_FR.ISO8859-15',
  710. 'bs': 'bs_BA.ISO8859-2',
  711. 'bs_ba': 'bs_BA.ISO8859-2',
  712. 'bs_ba.iso88592': 'bs_BA.ISO8859-2',
  713. 'bulgarian': 'bg_BG.CP1251',
  714. 'c': 'C',
  715. 'c-french': 'fr_CA.ISO8859-1',
  716. 'c-french.iso88591': 'fr_CA.ISO8859-1',
  717. 'c.en': 'C',
  718. 'c.iso88591': 'en_US.ISO8859-1',
  719. 'c_c': 'C',
  720. 'c_c.c': 'C',
  721. 'ca': 'ca_ES.ISO8859-1',
  722. 'ca_ad': 'ca_AD.ISO8859-1',
  723. 'ca_ad.iso88591': 'ca_AD.ISO8859-1',
  724. 'ca_ad.iso885915': 'ca_AD.ISO8859-15',
  725. 'ca_ad.iso885915@euro': 'ca_AD.ISO8859-15',
  726. 'ca_ad.utf8@euro': 'ca_AD.UTF-8',
  727. 'ca_ad@euro': 'ca_AD.ISO8859-15',
  728. 'ca_es': 'ca_ES.ISO8859-1',
  729. 'ca_es.iso88591': 'ca_ES.ISO8859-1',
  730. 'ca_es.iso885915': 'ca_ES.ISO8859-15',
  731. 'ca_es.iso885915@euro': 'ca_ES.ISO8859-15',
  732. 'ca_es.utf8@euro': 'ca_ES.UTF-8',
  733. 'ca_es@euro': 'ca_ES.ISO8859-15',
  734. 'ca_fr': 'ca_FR.ISO8859-1',
  735. 'ca_fr.iso88591': 'ca_FR.ISO8859-1',
  736. 'ca_fr.iso885915': 'ca_FR.ISO8859-15',
  737. 'ca_fr.iso885915@euro': 'ca_FR.ISO8859-15',
  738. 'ca_fr.utf8@euro': 'ca_FR.UTF-8',
  739. 'ca_fr@euro': 'ca_FR.ISO8859-15',
  740. 'ca_it': 'ca_IT.ISO8859-1',
  741. 'ca_it.iso88591': 'ca_IT.ISO8859-1',
  742. 'ca_it.iso885915': 'ca_IT.ISO8859-15',
  743. 'ca_it.iso885915@euro': 'ca_IT.ISO8859-15',
  744. 'ca_it.utf8@euro': 'ca_IT.UTF-8',
  745. 'ca_it@euro': 'ca_IT.ISO8859-15',
  746. 'catalan': 'ca_ES.ISO8859-1',
  747. 'cextend': 'en_US.ISO8859-1',
  748. 'cextend.en': 'en_US.ISO8859-1',
  749. 'chinese-s': 'zh_CN.eucCN',
  750. 'chinese-t': 'zh_TW.eucTW',
  751. 'croatian': 'hr_HR.ISO8859-2',
  752. 'cs': 'cs_CZ.ISO8859-2',
  753. 'cs_cs': 'cs_CZ.ISO8859-2',
  754. 'cs_cs.iso88592': 'cs_CS.ISO8859-2',
  755. 'cs_cz': 'cs_CZ.ISO8859-2',
  756. 'cs_cz.iso88592': 'cs_CZ.ISO8859-2',
  757. 'cy': 'cy_GB.ISO8859-1',
  758. 'cy_gb': 'cy_GB.ISO8859-1',
  759. 'cy_gb.iso88591': 'cy_GB.ISO8859-1',
  760. 'cy_gb.iso885914': 'cy_GB.ISO8859-14',
  761. 'cy_gb.iso885915': 'cy_GB.ISO8859-15',
  762. 'cy_gb@euro': 'cy_GB.ISO8859-15',
  763. 'cz': 'cs_CZ.ISO8859-2',
  764. 'cz_cz': 'cs_CZ.ISO8859-2',
  765. 'czech': 'cs_CZ.ISO8859-2',
  766. 'da': 'da_DK.ISO8859-1',
  767. 'da.iso885915': 'da_DK.ISO8859-15',
  768. 'da_dk': 'da_DK.ISO8859-1',
  769. 'da_dk.88591': 'da_DK.ISO8859-1',
  770. 'da_dk.885915': 'da_DK.ISO8859-15',
  771. 'da_dk.iso88591': 'da_DK.ISO8859-1',
  772. 'da_dk.iso885915': 'da_DK.ISO8859-15',
  773. 'da_dk@euro': 'da_DK.ISO8859-15',
  774. 'danish': 'da_DK.ISO8859-1',
  775. 'danish.iso88591': 'da_DK.ISO8859-1',
  776. 'dansk': 'da_DK.ISO8859-1',
  777. 'de': 'de_DE.ISO8859-1',
  778. 'de.iso885915': 'de_DE.ISO8859-15',
  779. 'de_at': 'de_AT.ISO8859-1',
  780. 'de_at.iso88591': 'de_AT.ISO8859-1',
  781. 'de_at.iso885915': 'de_AT.ISO8859-15',
  782. 'de_at.iso885915@euro': 'de_AT.ISO8859-15',
  783. 'de_at.utf8@euro': 'de_AT.UTF-8',
  784. 'de_at@euro': 'de_AT.ISO8859-15',
  785. 'de_be': 'de_BE.ISO8859-1',
  786. 'de_be.iso88591': 'de_BE.ISO8859-1',
  787. 'de_be.iso885915': 'de_BE.ISO8859-15',
  788. 'de_be.iso885915@euro': 'de_BE.ISO8859-15',
  789. 'de_be.utf8@euro': 'de_BE.UTF-8',
  790. 'de_be@euro': 'de_BE.ISO8859-15',
  791. 'de_ch': 'de_CH.ISO8859-1',
  792. 'de_ch.iso88591': 'de_CH.ISO8859-1',
  793. 'de_ch.iso885915': 'de_CH.ISO8859-15',
  794. 'de_ch@euro': 'de_CH.ISO8859-15',
  795. 'de_de': 'de_DE.ISO8859-1',
  796. 'de_de.88591': 'de_DE.ISO8859-1',
  797. 'de_de.885915': 'de_DE.ISO8859-15',
  798. 'de_de.885915@euro': 'de_DE.ISO8859-15',
  799. 'de_de.iso88591': 'de_DE.ISO8859-1',
  800. 'de_de.iso885915': 'de_DE.ISO8859-15',
  801. 'de_de.iso885915@euro': 'de_DE.ISO8859-15',
  802. 'de_de.utf8@euro': 'de_DE.UTF-8',
  803. 'de_de@euro': 'de_DE.ISO8859-15',
  804. 'de_lu': 'de_LU.ISO8859-1',
  805. 'de_lu.iso88591': 'de_LU.ISO8859-1',
  806. 'de_lu.iso885915': 'de_LU.ISO8859-15',
  807. 'de_lu.iso885915@euro': 'de_LU.ISO8859-15',
  808. 'de_lu.utf8@euro': 'de_LU.UTF-8',
  809. 'de_lu@euro': 'de_LU.ISO8859-15',
  810. 'deutsch': 'de_DE.ISO8859-1',
  811. 'dutch': 'nl_NL.ISO8859-1',
  812. 'dutch.iso88591': 'nl_BE.ISO8859-1',
  813. 'ee': 'ee_EE.ISO8859-4',
  814. 'ee_ee': 'ee_EE.ISO8859-4',
  815. 'ee_ee.iso88594': 'ee_EE.ISO8859-4',
  816. 'eesti': 'et_EE.ISO8859-1',
  817. 'el': 'el_GR.ISO8859-7',
  818. 'el_gr': 'el_GR.ISO8859-7',
  819. 'el_gr.iso88597': 'el_GR.ISO8859-7',
  820. 'el_gr@euro': 'el_GR.ISO8859-15',
  821. 'en': 'en_US.ISO8859-1',
  822. 'en.iso88591': 'en_US.ISO8859-1',
  823. 'en_au': 'en_AU.ISO8859-1',
  824. 'en_au.iso88591': 'en_AU.ISO8859-1',
  825. 'en_be': 'en_BE.ISO8859-1',
  826. 'en_be@euro': 'en_BE.ISO8859-15',
  827. 'en_bw': 'en_BW.ISO8859-1',
  828. 'en_bw.iso88591': 'en_BW.ISO8859-1',
  829. 'en_ca': 'en_CA.ISO8859-1',
  830. 'en_ca.iso88591': 'en_CA.ISO8859-1',
  831. 'en_gb': 'en_GB.ISO8859-1',
  832. 'en_gb.88591': 'en_GB.ISO8859-1',
  833. 'en_gb.iso88591': 'en_GB.ISO8859-1',
  834. 'en_gb.iso885915': 'en_GB.ISO8859-15',
  835. 'en_gb@euro': 'en_GB.ISO8859-15',
  836. 'en_hk': 'en_HK.ISO8859-1',
  837. 'en_hk.iso88591': 'en_HK.ISO8859-1',
  838. 'en_ie': 'en_IE.ISO8859-1',
  839. 'en_ie.iso88591': 'en_IE.ISO8859-1',
  840. 'en_ie.iso885915': 'en_IE.ISO8859-15',
  841. 'en_ie.iso885915@euro': 'en_IE.ISO8859-15',
  842. 'en_ie.utf8@euro': 'en_IE.UTF-8',
  843. 'en_ie@euro': 'en_IE.ISO8859-15',
  844. 'en_in': 'en_IN.ISO8859-1',
  845. 'en_nz': 'en_NZ.ISO8859-1',
  846. 'en_nz.iso88591': 'en_NZ.ISO8859-1',
  847. 'en_ph': 'en_PH.ISO8859-1',
  848. 'en_ph.iso88591': 'en_PH.ISO8859-1',
  849. 'en_sg': 'en_SG.ISO8859-1',
  850. 'en_sg.iso88591': 'en_SG.ISO8859-1',
  851. 'en_uk': 'en_GB.ISO8859-1',
  852. 'en_us': 'en_US.ISO8859-1',
  853. 'en_us.88591': 'en_US.ISO8859-1',
  854. 'en_us.885915': 'en_US.ISO8859-15',
  855. 'en_us.iso88591': 'en_US.ISO8859-1',
  856. 'en_us.iso885915': 'en_US.ISO8859-15',
  857. 'en_us.iso885915@euro': 'en_US.ISO8859-15',
  858. 'en_us@euro': 'en_US.ISO8859-15',
  859. 'en_us@euro@euro': 'en_US.ISO8859-15',
  860. 'en_za': 'en_ZA.ISO8859-1',
  861. 'en_za.88591': 'en_ZA.ISO8859-1',
  862. 'en_za.iso88591': 'en_ZA.ISO8859-1',
  863. 'en_za.iso885915': 'en_ZA.ISO8859-15',
  864. 'en_za@euro': 'en_ZA.ISO8859-15',
  865. 'en_zw': 'en_ZW.ISO8859-1',
  866. 'en_zw.iso88591': 'en_ZW.ISO8859-1',
  867. 'eng_gb': 'en_GB.ISO8859-1',
  868. 'eng_gb.8859': 'en_GB.ISO8859-1',
  869. 'english': 'en_EN.ISO8859-1',
  870. 'english.iso88591': 'en_EN.ISO8859-1',
  871. 'english_uk': 'en_GB.ISO8859-1',
  872. 'english_uk.8859': 'en_GB.ISO8859-1',
  873. 'english_united-states': 'en_US.ISO8859-1',
  874. 'english_united-states.437': 'C',
  875. 'english_us': 'en_US.ISO8859-1',
  876. 'english_us.8859': 'en_US.ISO8859-1',
  877. 'english_us.ascii': 'en_US.ISO8859-1',
  878. 'eo': 'eo_XX.ISO8859-3',
  879. 'eo_eo': 'eo_EO.ISO8859-3',
  880. 'eo_eo.iso88593': 'eo_EO.ISO8859-3',
  881. 'eo_xx': 'eo_XX.ISO8859-3',
  882. 'eo_xx.iso88593': 'eo_XX.ISO8859-3',
  883. 'es': 'es_ES.ISO8859-1',
  884. 'es_ar': 'es_AR.ISO8859-1',
  885. 'es_ar.iso88591': 'es_AR.ISO8859-1',
  886. 'es_bo': 'es_BO.ISO8859-1',
  887. 'es_bo.iso88591': 'es_BO.ISO8859-1',
  888. 'es_cl': 'es_CL.ISO8859-1',
  889. 'es_cl.iso88591': 'es_CL.ISO8859-1',
  890. 'es_co': 'es_CO.ISO8859-1',
  891. 'es_co.iso88591': 'es_CO.ISO8859-1',
  892. 'es_cr': 'es_CR.ISO8859-1',
  893. 'es_cr.iso88591': 'es_CR.ISO8859-1',
  894. 'es_do': 'es_DO.ISO8859-1',
  895. 'es_do.iso88591': 'es_DO.ISO8859-1',
  896. 'es_ec': 'es_EC.ISO8859-1',
  897. 'es_ec.iso88591': 'es_EC.ISO8859-1',
  898. 'es_es': 'es_ES.ISO8859-1',
  899. 'es_es.88591': 'es_ES.ISO8859-1',
  900. 'es_es.iso88591': 'es_ES.ISO8859-1',
  901. 'es_es.iso885915': 'es_ES.ISO8859-15',
  902. 'es_es.iso885915@euro': 'es_ES.ISO8859-15',
  903. 'es_es.utf8@euro': 'es_ES.UTF-8',
  904. 'es_es@euro': 'es_ES.ISO8859-15',
  905. 'es_gt': 'es_GT.ISO8859-1',
  906. 'es_gt.iso88591': 'es_GT.ISO8859-1',
  907. 'es_hn': 'es_HN.ISO8859-1',
  908. 'es_hn.iso88591': 'es_HN.ISO8859-1',
  909. 'es_mx': 'es_MX.ISO8859-1',
  910. 'es_mx.iso88591': 'es_MX.ISO8859-1',
  911. 'es_ni': 'es_NI.ISO8859-1',
  912. 'es_ni.iso88591': 'es_NI.ISO8859-1',
  913. 'es_pa': 'es_PA.ISO8859-1',
  914. 'es_pa.iso88591': 'es_PA.ISO8859-1',
  915. 'es_pa.iso885915': 'es_PA.ISO8859-15',
  916. 'es_pa@euro': 'es_PA.ISO8859-15',
  917. 'es_pe': 'es_PE.ISO8859-1',
  918. 'es_pe.iso88591': 'es_PE.ISO8859-1',
  919. 'es_pe.iso885915': 'es_PE.ISO8859-15',
  920. 'es_pe@euro': 'es_PE.ISO8859-15',
  921. 'es_pr': 'es_PR.ISO8859-1',
  922. 'es_pr.iso88591': 'es_PR.ISO8859-1',
  923. 'es_py': 'es_PY.ISO8859-1',
  924. 'es_py.iso88591': 'es_PY.ISO8859-1',
  925. 'es_py.iso885915': 'es_PY.ISO8859-15',
  926. 'es_py@euro': 'es_PY.ISO8859-15',
  927. 'es_sv': 'es_SV.ISO8859-1',
  928. 'es_sv.iso88591': 'es_SV.ISO8859-1',
  929. 'es_sv.iso885915': 'es_SV.ISO8859-15',
  930. 'es_sv@euro': 'es_SV.ISO8859-15',
  931. 'es_us': 'es_US.ISO8859-1',
  932. 'es_us.iso88591': 'es_US.ISO8859-1',
  933. 'es_uy': 'es_UY.ISO8859-1',
  934. 'es_uy.iso88591': 'es_UY.ISO8859-1',
  935. 'es_uy.iso885915': 'es_UY.ISO8859-15',
  936. 'es_uy@euro': 'es_UY.ISO8859-15',
  937. 'es_ve': 'es_VE.ISO8859-1',
  938. 'es_ve.iso88591': 'es_VE.ISO8859-1',
  939. 'es_ve.iso885915': 'es_VE.ISO8859-15',
  940. 'es_ve@euro': 'es_VE.ISO8859-15',
  941. 'estonian': 'et_EE.ISO8859-1',
  942. 'et': 'et_EE.ISO8859-15',
  943. 'et_ee': 'et_EE.ISO8859-15',
  944. 'et_ee.iso88591': 'et_EE.ISO8859-1',
  945. 'et_ee.iso885913': 'et_EE.ISO8859-13',
  946. 'et_ee.iso885915': 'et_EE.ISO8859-15',
  947. 'et_ee.iso88594': 'et_EE.ISO8859-4',
  948. 'et_ee@euro': 'et_EE.ISO8859-15',
  949. 'eu': 'eu_ES.ISO8859-1',
  950. 'eu_es': 'eu_ES.ISO8859-1',
  951. 'eu_es.iso88591': 'eu_ES.ISO8859-1',
  952. 'eu_es.iso885915': 'eu_ES.ISO8859-15',
  953. 'eu_es.iso885915@euro': 'eu_ES.ISO8859-15',
  954. 'eu_es.utf8@euro': 'eu_ES.UTF-8',
  955. 'eu_es@euro': 'eu_ES.ISO8859-15',
  956. 'fa': 'fa_IR.UTF-8',
  957. 'fa_ir': 'fa_IR.UTF-8',
  958. 'fa_ir.isiri3342': 'fa_IR.ISIRI-3342',
  959. 'fi': 'fi_FI.ISO8859-15',
  960. 'fi.iso885915': 'fi_FI.ISO8859-15',
  961. 'fi_fi': 'fi_FI.ISO8859-15',
  962. 'fi_fi.88591': 'fi_FI.ISO8859-1',
  963. 'fi_fi.iso88591': 'fi_FI.ISO8859-1',
  964. 'fi_fi.iso885915': 'fi_FI.ISO8859-15',
  965. 'fi_fi.iso885915@euro': 'fi_FI.ISO8859-15',
  966. 'fi_fi.utf8@euro': 'fi_FI.UTF-8',
  967. 'fi_fi@euro': 'fi_FI.ISO8859-15',
  968. 'finnish': 'fi_FI.ISO8859-1',
  969. 'finnish.iso88591': 'fi_FI.ISO8859-1',
  970. 'fo': 'fo_FO.ISO8859-1',
  971. 'fo_fo': 'fo_FO.ISO8859-1',
  972. 'fo_fo.iso88591': 'fo_FO.ISO8859-1',
  973. 'fo_fo.iso885915': 'fo_FO.ISO8859-15',
  974. 'fo_fo@euro': 'fo_FO.ISO8859-15',
  975. 'fr': 'fr_FR.ISO8859-1',
  976. 'fr.iso885915': 'fr_FR.ISO8859-15',
  977. 'fr_be': 'fr_BE.ISO8859-1',
  978. 'fr_be.88591': 'fr_BE.ISO8859-1',
  979. 'fr_be.iso88591': 'fr_BE.ISO8859-1',
  980. 'fr_be.iso885915': 'fr_BE.ISO8859-15',
  981. 'fr_be.iso885915@euro': 'fr_BE.ISO8859-15',
  982. 'fr_be.utf8@euro': 'fr_BE.UTF-8',
  983. 'fr_be@euro': 'fr_BE.ISO8859-15',
  984. 'fr_ca': 'fr_CA.ISO8859-1',
  985. 'fr_ca.88591': 'fr_CA.ISO8859-1',
  986. 'fr_ca.iso88591': 'fr_CA.ISO8859-1',
  987. 'fr_ca.iso885915': 'fr_CA.ISO8859-15',
  988. 'fr_ca@euro': 'fr_CA.ISO8859-15',
  989. 'fr_ch': 'fr_CH.ISO8859-1',
  990. 'fr_ch.88591': 'fr_CH.ISO8859-1',
  991. 'fr_ch.iso88591': 'fr_CH.ISO8859-1',
  992. 'fr_ch.iso885915': 'fr_CH.ISO8859-15',
  993. 'fr_ch@euro': 'fr_CH.ISO8859-15',
  994. 'fr_fr': 'fr_FR.ISO8859-1',
  995. 'fr_fr.88591': 'fr_FR.ISO8859-1',
  996. 'fr_fr.iso88591': 'fr_FR.ISO8859-1',
  997. 'fr_fr.iso885915': 'fr_FR.ISO8859-15',
  998. 'fr_fr.iso885915@euro': 'fr_FR.ISO8859-15',
  999. 'fr_fr.utf8@euro': 'fr_FR.UTF-8',
  1000. 'fr_fr@euro': 'fr_FR.ISO8859-15',
  1001. 'fr_lu': 'fr_LU.ISO8859-1',
  1002. 'fr_lu.88591': 'fr_LU.ISO8859-1',
  1003. 'fr_lu.iso88591': 'fr_LU.ISO8859-1',
  1004. 'fr_lu.iso885915': 'fr_LU.ISO8859-15',
  1005. 'fr_lu.iso885915@euro': 'fr_LU.ISO8859-15',
  1006. 'fr_lu.utf8@euro': 'fr_LU.UTF-8',
  1007. 'fr_lu@euro': 'fr_LU.ISO8859-15',
  1008. 'fran\xe7ais': 'fr_FR.ISO8859-1',
  1009. 'fre_fr': 'fr_FR.ISO8859-1',
  1010. 'fre_fr.8859': 'fr_FR.ISO8859-1',
  1011. 'french': 'fr_FR.ISO8859-1',
  1012. 'french.iso88591': 'fr_CH.ISO8859-1',
  1013. 'french_france': 'fr_FR.ISO8859-1',
  1014. 'french_france.8859': 'fr_FR.ISO8859-1',
  1015. 'ga': 'ga_IE.ISO8859-1',
  1016. 'ga_ie': 'ga_IE.ISO8859-1',
  1017. 'ga_ie.iso88591': 'ga_IE.ISO8859-1',
  1018. 'ga_ie.iso885914': 'ga_IE.ISO8859-14',
  1019. 'ga_ie.iso885915': 'ga_IE.ISO8859-15',
  1020. 'ga_ie.iso885915@euro': 'ga_IE.ISO8859-15',
  1021. 'ga_ie.utf8@euro': 'ga_IE.UTF-8',
  1022. 'ga_ie@euro': 'ga_IE.ISO8859-15',
  1023. 'galego': 'gl_ES.ISO8859-1',
  1024. 'galician': 'gl_ES.ISO8859-1',
  1025. 'gd': 'gd_GB.ISO8859-1',
  1026. 'gd_gb': 'gd_GB.ISO8859-1',
  1027. 'gd_gb.iso88591': 'gd_GB.ISO8859-1',
  1028. 'gd_gb.iso885914': 'gd_GB.ISO8859-14',
  1029. 'gd_gb.iso885915': 'gd_GB.ISO8859-15',
  1030. 'gd_gb@euro': 'gd_GB.ISO8859-15',
  1031. 'ger_de': 'de_DE.ISO8859-1',
  1032. 'ger_de.8859': 'de_DE.ISO8859-1',
  1033. 'german': 'de_DE.ISO8859-1',
  1034. 'german.iso88591': 'de_CH.ISO8859-1',
  1035. 'german_germany': 'de_DE.ISO8859-1',
  1036. 'german_germany.8859': 'de_DE.ISO8859-1',
  1037. 'gl': 'gl_ES.ISO8859-1',
  1038. 'gl_es': 'gl_ES.ISO8859-1',
  1039. 'gl_es.iso88591': 'gl_ES.ISO8859-1',
  1040. 'gl_es.iso885915': 'gl_ES.ISO8859-15',
  1041. 'gl_es.iso885915@euro': 'gl_ES.ISO8859-15',
  1042. 'gl_es.utf8@euro': 'gl_ES.UTF-8',
  1043. 'gl_es@euro': 'gl_ES.ISO8859-15',
  1044. 'greek': 'el_GR.ISO8859-7',
  1045. 'greek.iso88597': 'el_GR.ISO8859-7',
  1046. 'gu_in': 'gu_IN.UTF-8',
  1047. 'gv': 'gv_GB.ISO8859-1',
  1048. 'gv_gb': 'gv_GB.ISO8859-1',
  1049. 'gv_gb.iso88591': 'gv_GB.ISO8859-1',
  1050. 'gv_gb.iso885914': 'gv_GB.ISO8859-14',
  1051. 'gv_gb.iso885915': 'gv_GB.ISO8859-15',
  1052. 'gv_gb@euro': 'gv_GB.ISO8859-15',
  1053. 'he': 'he_IL.ISO8859-8',
  1054. 'he_il': 'he_IL.ISO8859-8',
  1055. 'he_il.cp1255': 'he_IL.CP1255',
  1056. 'he_il.iso88598': 'he_IL.ISO8859-8',
  1057. 'he_il.microsoftcp1255': 'he_IL.CP1255',
  1058. 'hebrew': 'iw_IL.ISO8859-8',
  1059. 'hebrew.iso88598': 'iw_IL.ISO8859-8',
  1060. 'hi': 'hi_IN.ISCII-DEV',
  1061. 'hi_in': 'hi_IN.ISCII-DEV',
  1062. 'hi_in.isciidev': 'hi_IN.ISCII-DEV',
  1063. 'hne': 'hne_IN.UTF-8',
  1064. 'hr': 'hr_HR.ISO8859-2',
  1065. 'hr_hr': 'hr_HR.ISO8859-2',
  1066. 'hr_hr.iso88592': 'hr_HR.ISO8859-2',
  1067. 'hrvatski': 'hr_HR.ISO8859-2',
  1068. 'hu': 'hu_HU.ISO8859-2',
  1069. 'hu_hu': 'hu_HU.ISO8859-2',
  1070. 'hu_hu.iso88592': 'hu_HU.ISO8859-2',
  1071. 'hungarian': 'hu_HU.ISO8859-2',
  1072. 'icelandic': 'is_IS.ISO8859-1',
  1073. 'icelandic.iso88591': 'is_IS.ISO8859-1',
  1074. 'id': 'id_ID.ISO8859-1',
  1075. 'id_id': 'id_ID.ISO8859-1',
  1076. 'in': 'id_ID.ISO8859-1',
  1077. 'in_id': 'id_ID.ISO8859-1',
  1078. 'is': 'is_IS.ISO8859-1',
  1079. 'is_is': 'is_IS.ISO8859-1',
  1080. 'is_is.iso88591': 'is_IS.ISO8859-1',
  1081. 'is_is.iso885915': 'is_IS.ISO8859-15',
  1082. 'is_is@euro': 'is_IS.ISO8859-15',
  1083. 'iso-8859-1': 'en_US.ISO8859-1',
  1084. 'iso-8859-15': 'en_US.ISO8859-15',
  1085. 'iso8859-1': 'en_US.ISO8859-1',
  1086. 'iso8859-15': 'en_US.ISO8859-15',
  1087. 'iso_8859_1': 'en_US.ISO8859-1',
  1088. 'iso_8859_15': 'en_US.ISO8859-15',
  1089. 'it': 'it_IT.ISO8859-1',
  1090. 'it.iso885915': 'it_IT.ISO8859-15',
  1091. 'it_ch': 'it_CH.ISO8859-1',
  1092. 'it_ch.iso88591': 'it_CH.ISO8859-1',
  1093. 'it_ch.iso885915': 'it_CH.ISO8859-15',
  1094. 'it_ch@euro': 'it_CH.ISO8859-15',
  1095. 'it_it': 'it_IT.ISO8859-1',
  1096. 'it_it.88591': 'it_IT.ISO8859-1',
  1097. 'it_it.iso88591': 'it_IT.ISO8859-1',
  1098. 'it_it.iso885915': 'it_IT.ISO8859-15',
  1099. 'it_it.iso885915@euro': 'it_IT.ISO8859-15',
  1100. 'it_it.utf8@euro': 'it_IT.UTF-8',
  1101. 'it_it@euro': 'it_IT.ISO8859-15',
  1102. 'italian': 'it_IT.ISO8859-1',
  1103. 'italian.iso88591': 'it_IT.ISO8859-1',
  1104. 'iu': 'iu_CA.NUNACOM-8',
  1105. 'iu_ca': 'iu_CA.NUNACOM-8',
  1106. 'iu_ca.nunacom8': 'iu_CA.NUNACOM-8',
  1107. 'iw': 'he_IL.ISO8859-8',
  1108. 'iw_il': 'he_IL.ISO8859-8',
  1109. 'iw_il.iso88598': 'he_IL.ISO8859-8',
  1110. 'ja': 'ja_JP.eucJP',
  1111. 'ja.jis': 'ja_JP.JIS7',
  1112. 'ja.sjis': 'ja_JP.SJIS',
  1113. 'ja_jp': 'ja_JP.eucJP',
  1114. 'ja_jp.ajec': 'ja_JP.eucJP',
  1115. 'ja_jp.euc': 'ja_JP.eucJP',
  1116. 'ja_jp.eucjp': 'ja_JP.eucJP',
  1117. 'ja_jp.iso-2022-jp': 'ja_JP.JIS7',
  1118. 'ja_jp.iso2022jp': 'ja_JP.JIS7',
  1119. 'ja_jp.jis': 'ja_JP.JIS7',
  1120. 'ja_jp.jis7': 'ja_JP.JIS7',
  1121. 'ja_jp.mscode': 'ja_JP.SJIS',
  1122. 'ja_jp.pck': 'ja_JP.SJIS',
  1123. 'ja_jp.sjis': 'ja_JP.SJIS',
  1124. 'ja_jp.ujis': 'ja_JP.eucJP',
  1125. 'japan': 'ja_JP.eucJP',
  1126. 'japanese': 'ja_JP.eucJP',
  1127. 'japanese-euc': 'ja_JP.eucJP',
  1128. 'japanese.euc': 'ja_JP.eucJP',
  1129. 'japanese.sjis': 'ja_JP.SJIS',
  1130. 'jp_jp': 'ja_JP.eucJP',
  1131. 'ka': 'ka_GE.GEORGIAN-ACADEMY',
  1132. 'ka_ge': 'ka_GE.GEORGIAN-ACADEMY',
  1133. 'ka_ge.georgianacademy': 'ka_GE.GEORGIAN-ACADEMY',
  1134. 'ka_ge.georgianps': 'ka_GE.GEORGIAN-PS',
  1135. 'ka_ge.georgianrs': 'ka_GE.GEORGIAN-ACADEMY',
  1136. 'kl': 'kl_GL.ISO8859-1',
  1137. 'kl_gl': 'kl_GL.ISO8859-1',
  1138. 'kl_gl.iso88591': 'kl_GL.ISO8859-1',
  1139. 'kl_gl.iso885915': 'kl_GL.ISO8859-15',
  1140. 'kl_gl@euro': 'kl_GL.ISO8859-15',
  1141. 'km_kh': 'km_KH.UTF-8',
  1142. 'kn': 'kn_IN.UTF-8',
  1143. 'kn_in': 'kn_IN.UTF-8',
  1144. 'ko': 'ko_KR.eucKR',
  1145. 'ko_kr': 'ko_KR.eucKR',
  1146. 'ko_kr.euc': 'ko_KR.eucKR',
  1147. 'ko_kr.euckr': 'ko_KR.eucKR',
  1148. 'korean': 'ko_KR.eucKR',
  1149. 'korean.euc': 'ko_KR.eucKR',
  1150. 'ks': 'ks_IN.UTF-8',
  1151. 'ks_in@devanagari': 'ks_IN@devanagari.UTF-8',
  1152. 'kw': 'kw_GB.ISO8859-1',
  1153. 'kw_gb': 'kw_GB.ISO8859-1',
  1154. 'kw_gb.iso88591': 'kw_GB.ISO8859-1',
  1155. 'kw_gb.iso885914': 'kw_GB.ISO8859-14',
  1156. 'kw_gb.iso885915': 'kw_GB.ISO8859-15',
  1157. 'kw_gb@euro': 'kw_GB.ISO8859-15',
  1158. 'ky': 'ky_KG.UTF-8',
  1159. 'ky_kg': 'ky_KG.UTF-8',
  1160. 'lithuanian': 'lt_LT.ISO8859-13',
  1161. 'lo': 'lo_LA.MULELAO-1',
  1162. 'lo_la': 'lo_LA.MULELAO-1',
  1163. 'lo_la.cp1133': 'lo_LA.IBM-CP1133',
  1164. 'lo_la.ibmcp1133': 'lo_LA.IBM-CP1133',
  1165. 'lo_la.mulelao1': 'lo_LA.MULELAO-1',
  1166. 'lt': 'lt_LT.ISO8859-13',
  1167. 'lt_lt': 'lt_LT.ISO8859-13',
  1168. 'lt_lt.iso885913': 'lt_LT.ISO8859-13',
  1169. 'lt_lt.iso88594': 'lt_LT.ISO8859-4',
  1170. 'lv': 'lv_LV.ISO8859-13',
  1171. 'lv_lv': 'lv_LV.ISO8859-13',
  1172. 'lv_lv.iso885913': 'lv_LV.ISO8859-13',
  1173. 'lv_lv.iso88594': 'lv_LV.ISO8859-4',
  1174. 'mai': 'mai_IN.UTF-8',
  1175. 'mi': 'mi_NZ.ISO8859-1',
  1176. 'mi_nz': 'mi_NZ.ISO8859-1',
  1177. 'mi_nz.iso88591': 'mi_NZ.ISO8859-1',
  1178. 'mk': 'mk_MK.ISO8859-5',
  1179. 'mk_mk': 'mk_MK.ISO8859-5',
  1180. 'mk_mk.cp1251': 'mk_MK.CP1251',
  1181. 'mk_mk.iso88595': 'mk_MK.ISO8859-5',
  1182. 'mk_mk.microsoftcp1251': 'mk_MK.CP1251',
  1183. 'ml': 'ml_IN.UTF-8',
  1184. 'mr': 'mr_IN.UTF-8',
  1185. 'mr_in': 'mr_IN.UTF-8',
  1186. 'ms': 'ms_MY.ISO8859-1',
  1187. 'ms_my': 'ms_MY.ISO8859-1',
  1188. 'ms_my.iso88591': 'ms_MY.ISO8859-1',
  1189. 'mt': 'mt_MT.ISO8859-3',
  1190. 'mt_mt': 'mt_MT.ISO8859-3',
  1191. 'mt_mt.iso88593': 'mt_MT.ISO8859-3',
  1192. 'nb': 'nb_NO.ISO8859-1',
  1193. 'nb_no': 'nb_NO.ISO8859-1',
  1194. 'nb_no.88591': 'nb_NO.ISO8859-1',
  1195. 'nb_no.iso88591': 'nb_NO.ISO8859-1',
  1196. 'nb_no.iso885915': 'nb_NO.ISO8859-15',
  1197. 'nb_no@euro': 'nb_NO.ISO8859-15',
  1198. 'nl': 'nl_NL.ISO8859-1',
  1199. 'nl.iso885915': 'nl_NL.ISO8859-15',
  1200. 'nl_be': 'nl_BE.ISO8859-1',
  1201. 'nl_be.88591': 'nl_BE.ISO8859-1',
  1202. 'nl_be.iso88591': 'nl_BE.ISO8859-1',
  1203. 'nl_be.iso885915': 'nl_BE.ISO8859-15',
  1204. 'nl_be.iso885915@euro': 'nl_BE.ISO8859-15',
  1205. 'nl_be.utf8@euro': 'nl_BE.UTF-8',
  1206. 'nl_be@euro': 'nl_BE.ISO8859-15',
  1207. 'nl_nl': 'nl_NL.ISO8859-1',
  1208. 'nl_nl.88591': 'nl_NL.ISO8859-1',
  1209. 'nl_nl.iso88591': 'nl_NL.ISO8859-1',
  1210. 'nl_nl.iso885915': 'nl_NL.ISO8859-15',
  1211. 'nl_nl.iso885915@euro': 'nl_NL.ISO8859-15',
  1212. 'nl_nl.utf8@euro': 'nl_NL.UTF-8',
  1213. 'nl_nl@euro': 'nl_NL.ISO8859-15',
  1214. 'nn': 'nn_NO.ISO8859-1',
  1215. 'nn_no': 'nn_NO.ISO8859-1',
  1216. 'nn_no.88591': 'nn_NO.ISO8859-1',
  1217. 'nn_no.iso88591': 'nn_NO.ISO8859-1',
  1218. 'nn_no.iso885915': 'nn_NO.ISO8859-15',
  1219. 'nn_no@euro': 'nn_NO.ISO8859-15',
  1220. 'no': 'no_NO.ISO8859-1',
  1221. 'no@nynorsk': 'ny_NO.ISO8859-1',
  1222. 'no_no': 'no_NO.ISO8859-1',
  1223. 'no_no.88591': 'no_NO.ISO8859-1',
  1224. 'no_no.iso88591': 'no_NO.ISO8859-1',
  1225. 'no_no.iso885915': 'no_NO.ISO8859-15',
  1226. 'no_no.iso88591@bokmal': 'no_NO.ISO8859-1',
  1227. 'no_no.iso88591@nynorsk': 'no_NO.ISO8859-1',
  1228. 'no_no@euro': 'no_NO.ISO8859-15',
  1229. 'norwegian': 'no_NO.ISO8859-1',
  1230. 'norwegian.iso88591': 'no_NO.ISO8859-1',
  1231. 'nr': 'nr_ZA.ISO8859-1',
  1232. 'nr_za': 'nr_ZA.ISO8859-1',
  1233. 'nr_za.iso88591': 'nr_ZA.ISO8859-1',
  1234. 'nso': 'nso_ZA.ISO8859-15',
  1235. 'nso_za': 'nso_ZA.ISO8859-15',
  1236. 'nso_za.iso885915': 'nso_ZA.ISO8859-15',
  1237. 'ny': 'ny_NO.ISO8859-1',
  1238. 'ny_no': 'ny_NO.ISO8859-1',
  1239. 'ny_no.88591': 'ny_NO.ISO8859-1',
  1240. 'ny_no.iso88591': 'ny_NO.ISO8859-1',
  1241. 'ny_no.iso885915': 'ny_NO.ISO8859-15',
  1242. 'ny_no@euro': 'ny_NO.ISO8859-15',
  1243. 'nynorsk': 'nn_NO.ISO8859-1',
  1244. 'oc': 'oc_FR.ISO8859-1',
  1245. 'oc_fr': 'oc_FR.ISO8859-1',
  1246. 'oc_fr.iso88591': 'oc_FR.ISO8859-1',
  1247. 'oc_fr.iso885915': 'oc_FR.ISO8859-15',
  1248. 'oc_fr@euro': 'oc_FR.ISO8859-15',
  1249. 'or': 'or_IN.UTF-8',
  1250. 'pa': 'pa_IN.UTF-8',
  1251. 'pa_in': 'pa_IN.UTF-8',
  1252. 'pd': 'pd_US.ISO8859-1',
  1253. 'pd_de': 'pd_DE.ISO8859-1',
  1254. 'pd_de.iso88591': 'pd_DE.ISO8859-1',
  1255. 'pd_de.iso885915': 'pd_DE.ISO8859-15',
  1256. 'pd_de@euro': 'pd_DE.ISO8859-15',
  1257. 'pd_us': 'pd_US.ISO8859-1',
  1258. 'pd_us.iso88591': 'pd_US.ISO8859-1',
  1259. 'pd_us.iso885915': 'pd_US.ISO8859-15',
  1260. 'pd_us@euro': 'pd_US.ISO8859-15',
  1261. 'ph': 'ph_PH.ISO8859-1',
  1262. 'ph_ph': 'ph_PH.ISO8859-1',
  1263. 'ph_ph.iso88591': 'ph_PH.ISO8859-1',
  1264. 'pl': 'pl_PL.ISO8859-2',
  1265. 'pl_pl': 'pl_PL.ISO8859-2',
  1266. 'pl_pl.iso88592': 'pl_PL.ISO8859-2',
  1267. 'polish': 'pl_PL.ISO8859-2',
  1268. 'portuguese': 'pt_PT.ISO8859-1',
  1269. 'portuguese.iso88591': 'pt_PT.ISO8859-1',
  1270. 'portuguese_brazil': 'pt_BR.ISO8859-1',
  1271. 'portuguese_brazil.8859': 'pt_BR.ISO8859-1',
  1272. 'posix': 'C',
  1273. 'posix-utf2': 'C',
  1274. 'pp': 'pp_AN.ISO8859-1',
  1275. 'pp_an': 'pp_AN.ISO8859-1',
  1276. 'pp_an.iso88591': 'pp_AN.ISO8859-1',
  1277. 'pt': 'pt_PT.ISO8859-1',
  1278. 'pt.iso885915': 'pt_PT.ISO8859-15',
  1279. 'pt_br': 'pt_BR.ISO8859-1',
  1280. 'pt_br.88591': 'pt_BR.ISO8859-1',
  1281. 'pt_br.iso88591': 'pt_BR.ISO8859-1',
  1282. 'pt_br.iso885915': 'pt_BR.ISO8859-15',
  1283. 'pt_br@euro': 'pt_BR.ISO8859-15',
  1284. 'pt_pt': 'pt_PT.ISO8859-1',
  1285. 'pt_pt.88591': 'pt_PT.ISO8859-1',
  1286. 'pt_pt.iso88591': 'pt_PT.ISO8859-1',
  1287. 'pt_pt.iso885915': 'pt_PT.ISO8859-15',
  1288. 'pt_pt.iso885915@euro': 'pt_PT.ISO8859-15',
  1289. 'pt_pt.utf8@euro': 'pt_PT.UTF-8',
  1290. 'pt_pt@euro': 'pt_PT.ISO8859-15',
  1291. 'ro': 'ro_RO.ISO8859-2',
  1292. 'ro_ro': 'ro_RO.ISO8859-2',
  1293. 'ro_ro.iso88592': 'ro_RO.ISO8859-2',
  1294. 'romanian': 'ro_RO.ISO8859-2',
  1295. 'ru': 'ru_RU.UTF-8',
  1296. 'ru.koi8r': 'ru_RU.KOI8-R',
  1297. 'ru_ru': 'ru_RU.UTF-8',
  1298. 'ru_ru.cp1251': 'ru_RU.CP1251',
  1299. 'ru_ru.iso88595': 'ru_RU.ISO8859-5',
  1300. 'ru_ru.koi8r': 'ru_RU.KOI8-R',
  1301. 'ru_ru.microsoftcp1251': 'ru_RU.CP1251',
  1302. 'ru_ua': 'ru_UA.KOI8-U',
  1303. 'ru_ua.cp1251': 'ru_UA.CP1251',
  1304. 'ru_ua.koi8u': 'ru_UA.KOI8-U',
  1305. 'ru_ua.microsoftcp1251': 'ru_UA.CP1251',
  1306. 'rumanian': 'ro_RO.ISO8859-2',
  1307. 'russian': 'ru_RU.ISO8859-5',
  1308. 'rw': 'rw_RW.ISO8859-1',
  1309. 'rw_rw': 'rw_RW.ISO8859-1',
  1310. 'rw_rw.iso88591': 'rw_RW.ISO8859-1',
  1311. 'sd': 'sd_IN@devanagari.UTF-8',
  1312. 'se_no': 'se_NO.UTF-8',
  1313. 'serbocroatian': 'sr_RS.UTF-8@latin',
  1314. 'sh': 'sr_RS.UTF-8@latin',
  1315. 'sh_ba.iso88592@bosnia': 'sr_CS.ISO8859-2',
  1316. 'sh_hr': 'sh_HR.ISO8859-2',
  1317. 'sh_hr.iso88592': 'hr_HR.ISO8859-2',
  1318. 'sh_sp': 'sr_CS.ISO8859-2',
  1319. 'sh_yu': 'sr_RS.UTF-8@latin',
  1320. 'si': 'si_LK.UTF-8',
  1321. 'si_lk': 'si_LK.UTF-8',
  1322. 'sinhala': 'si_LK.UTF-8',
  1323. 'sk': 'sk_SK.ISO8859-2',
  1324. 'sk_sk': 'sk_SK.ISO8859-2',
  1325. 'sk_sk.iso88592': 'sk_SK.ISO8859-2',
  1326. 'sl': 'sl_SI.ISO8859-2',
  1327. 'sl_cs': 'sl_CS.ISO8859-2',
  1328. 'sl_si': 'sl_SI.ISO8859-2',
  1329. 'sl_si.iso88592': 'sl_SI.ISO8859-2',
  1330. 'slovak': 'sk_SK.ISO8859-2',
  1331. 'slovene': 'sl_SI.ISO8859-2',
  1332. 'slovenian': 'sl_SI.ISO8859-2',
  1333. 'sp': 'sr_CS.ISO8859-5',
  1334. 'sp_yu': 'sr_CS.ISO8859-5',
  1335. 'spanish': 'es_ES.ISO8859-1',
  1336. 'spanish.iso88591': 'es_ES.ISO8859-1',
  1337. 'spanish_spain': 'es_ES.ISO8859-1',
  1338. 'spanish_spain.8859': 'es_ES.ISO8859-1',
  1339. 'sq': 'sq_AL.ISO8859-2',
  1340. 'sq_al': 'sq_AL.ISO8859-2',
  1341. 'sq_al.iso88592': 'sq_AL.ISO8859-2',
  1342. 'sr': 'sr_RS.UTF-8',
  1343. 'sr@cyrillic': 'sr_RS.UTF-8',
  1344. 'sr@latin': 'sr_RS.UTF-8@latin',
  1345. 'sr@latn': 'sr_RS.UTF-8@latin',
  1346. 'sr_cs': 'sr_RS.UTF-8',
  1347. 'sr_cs.iso88592': 'sr_CS.ISO8859-2',
  1348. 'sr_cs.iso88592@latn': 'sr_CS.ISO8859-2',
  1349. 'sr_cs.iso88595': 'sr_CS.ISO8859-5',
  1350. 'sr_cs.utf8@latn': 'sr_RS.UTF-8@latin',
  1351. 'sr_cs@latn': 'sr_RS.UTF-8@latin',
  1352. 'sr_me': 'sr_ME.UTF-8',
  1353. 'sr_rs': 'sr_RS.UTF-8',
  1354. 'sr_rs.utf8@latn': 'sr_RS.UTF-8@latin',
  1355. 'sr_rs@latin': 'sr_RS.UTF-8@latin',
  1356. 'sr_rs@latn': 'sr_RS.UTF-8@latin',
  1357. 'sr_sp': 'sr_CS.ISO8859-2',
  1358. 'sr_yu': 'sr_RS.UTF-8@latin',
  1359. 'sr_yu.cp1251@cyrillic': 'sr_CS.CP1251',
  1360. 'sr_yu.iso88592': 'sr_CS.ISO8859-2',
  1361. 'sr_yu.iso88595': 'sr_CS.ISO8859-5',
  1362. 'sr_yu.iso88595@cyrillic': 'sr_CS.ISO8859-5',
  1363. 'sr_yu.microsoftcp1251@cyrillic': 'sr_CS.CP1251',
  1364. 'sr_yu.utf8@cyrillic': 'sr_RS.UTF-8',
  1365. 'sr_yu@cyrillic': 'sr_RS.UTF-8',
  1366. 'ss': 'ss_ZA.ISO8859-1',
  1367. 'ss_za': 'ss_ZA.ISO8859-1',
  1368. 'ss_za.iso88591': 'ss_ZA.ISO8859-1',
  1369. 'st': 'st_ZA.ISO8859-1',
  1370. 'st_za': 'st_ZA.ISO8859-1',
  1371. 'st_za.iso88591': 'st_ZA.ISO8859-1',
  1372. 'sv': 'sv_SE.ISO8859-1',
  1373. 'sv.iso885915': 'sv_SE.ISO8859-15',
  1374. 'sv_fi': 'sv_FI.ISO8859-1',
  1375. 'sv_fi.iso88591': 'sv_FI.ISO8859-1',
  1376. 'sv_fi.iso885915': 'sv_FI.ISO8859-15',
  1377. 'sv_fi.iso885915@euro': 'sv_FI.ISO8859-15',
  1378. 'sv_fi.utf8@euro': 'sv_FI.UTF-8',
  1379. 'sv_fi@euro': 'sv_FI.ISO8859-15',
  1380. 'sv_se': 'sv_SE.ISO8859-1',
  1381. 'sv_se.88591': 'sv_SE.ISO8859-1',
  1382. 'sv_se.iso88591': 'sv_SE.ISO8859-1',
  1383. 'sv_se.iso885915': 'sv_SE.ISO8859-15',
  1384. 'sv_se@euro': 'sv_SE.ISO8859-15',
  1385. 'swedish': 'sv_SE.ISO8859-1',
  1386. 'swedish.iso88591': 'sv_SE.ISO8859-1',
  1387. 'ta': 'ta_IN.TSCII-0',
  1388. 'ta_in': 'ta_IN.TSCII-0',
  1389. 'ta_in.tscii': 'ta_IN.TSCII-0',
  1390. 'ta_in.tscii0': 'ta_IN.TSCII-0',
  1391. 'te': 'te_IN.UTF-8',
  1392. 'tg': 'tg_TJ.KOI8-C',
  1393. 'tg_tj': 'tg_TJ.KOI8-C',
  1394. 'tg_tj.koi8c': 'tg_TJ.KOI8-C',
  1395. 'th': 'th_TH.ISO8859-11',
  1396. 'th_th': 'th_TH.ISO8859-11',
  1397. 'th_th.iso885911': 'th_TH.ISO8859-11',
  1398. 'th_th.tactis': 'th_TH.TIS620',
  1399. 'th_th.tis620': 'th_TH.TIS620',
  1400. 'thai': 'th_TH.ISO8859-11',
  1401. 'tl': 'tl_PH.ISO8859-1',
  1402. 'tl_ph': 'tl_PH.ISO8859-1',
  1403. 'tl_ph.iso88591': 'tl_PH.ISO8859-1',
  1404. 'tn': 'tn_ZA.ISO8859-15',
  1405. 'tn_za': 'tn_ZA.ISO8859-15',
  1406. 'tn_za.iso885915': 'tn_ZA.ISO8859-15',
  1407. 'tr': 'tr_TR.ISO8859-9',
  1408. 'tr_tr': 'tr_TR.ISO8859-9',
  1409. 'tr_tr.iso88599': 'tr_TR.ISO8859-9',
  1410. 'ts': 'ts_ZA.ISO8859-1',
  1411. 'ts_za': 'ts_ZA.ISO8859-1',
  1412. 'ts_za.iso88591': 'ts_ZA.ISO8859-1',
  1413. 'tt': 'tt_RU.TATAR-CYR',
  1414. 'tt_ru': 'tt_RU.TATAR-CYR',
  1415. 'tt_ru.koi8c': 'tt_RU.KOI8-C',
  1416. 'tt_ru.tatarcyr': 'tt_RU.TATAR-CYR',
  1417. 'turkish': 'tr_TR.ISO8859-9',
  1418. 'turkish.iso88599': 'tr_TR.ISO8859-9',
  1419. 'uk': 'uk_UA.KOI8-U',
  1420. 'uk_ua': 'uk_UA.KOI8-U',
  1421. 'uk_ua.cp1251': 'uk_UA.CP1251',
  1422. 'uk_ua.iso88595': 'uk_UA.ISO8859-5',
  1423. 'uk_ua.koi8u': 'uk_UA.KOI8-U',
  1424. 'uk_ua.microsoftcp1251': 'uk_UA.CP1251',
  1425. 'univ': 'en_US.utf',
  1426. 'universal': 'en_US.utf',
  1427. 'universal.utf8@ucs4': 'en_US.UTF-8',
  1428. 'ur': 'ur_PK.CP1256',
  1429. 'ur_pk': 'ur_PK.CP1256',
  1430. 'ur_pk.cp1256': 'ur_PK.CP1256',
  1431. 'ur_pk.microsoftcp1256': 'ur_PK.CP1256',
  1432. 'uz': 'uz_UZ.UTF-8',
  1433. 'uz_uz': 'uz_UZ.UTF-8',
  1434. 'uz_uz.iso88591': 'uz_UZ.ISO8859-1',
  1435. 'uz_uz.utf8@cyrillic': 'uz_UZ.UTF-8',
  1436. 'uz_uz@cyrillic': 'uz_UZ.UTF-8',
  1437. 've': 've_ZA.UTF-8',
  1438. 've_za': 've_ZA.UTF-8',
  1439. 'vi': 'vi_VN.TCVN',
  1440. 'vi_vn': 'vi_VN.TCVN',
  1441. 'vi_vn.tcvn': 'vi_VN.TCVN',
  1442. 'vi_vn.tcvn5712': 'vi_VN.TCVN',
  1443. 'vi_vn.viscii': 'vi_VN.VISCII',
  1444. 'vi_vn.viscii111': 'vi_VN.VISCII',
  1445. 'wa': 'wa_BE.ISO8859-1',
  1446. 'wa_be': 'wa_BE.ISO8859-1',
  1447. 'wa_be.iso88591': 'wa_BE.ISO8859-1',
  1448. 'wa_be.iso885915': 'wa_BE.ISO8859-15',
  1449. 'wa_be.iso885915@euro': 'wa_BE.ISO8859-15',
  1450. 'wa_be@euro': 'wa_BE.ISO8859-15',
  1451. 'xh': 'xh_ZA.ISO8859-1',
  1452. 'xh_za': 'xh_ZA.ISO8859-1',
  1453. 'xh_za.iso88591': 'xh_ZA.ISO8859-1',
  1454. 'yi': 'yi_US.CP1255',
  1455. 'yi_us': 'yi_US.CP1255',
  1456. 'yi_us.cp1255': 'yi_US.CP1255',
  1457. 'yi_us.microsoftcp1255': 'yi_US.CP1255',
  1458. 'zh': 'zh_CN.eucCN',
  1459. 'zh_cn': 'zh_CN.gb2312',
  1460. 'zh_cn.big5': 'zh_TW.big5',
  1461. 'zh_cn.euc': 'zh_CN.eucCN',
  1462. 'zh_cn.gb18030': 'zh_CN.gb18030',
  1463. 'zh_cn.gb2312': 'zh_CN.gb2312',
  1464. 'zh_cn.gbk': 'zh_CN.gbk',
  1465. 'zh_hk': 'zh_HK.big5hkscs',
  1466. 'zh_hk.big5': 'zh_HK.big5',
  1467. 'zh_hk.big5hk': 'zh_HK.big5hkscs',
  1468. 'zh_hk.big5hkscs': 'zh_HK.big5hkscs',
  1469. 'zh_tw': 'zh_TW.big5',
  1470. 'zh_tw.big5': 'zh_TW.big5',
  1471. 'zh_tw.euc': 'zh_TW.eucTW',
  1472. 'zh_tw.euctw': 'zh_TW.eucTW',
  1473. 'zu': 'zu_ZA.ISO8859-1',
  1474. 'zu_za': 'zu_ZA.ISO8859-1',
  1475. 'zu_za.iso88591': 'zu_ZA.ISO8859-1',
  1476. }
  1477. #
  1478. # This maps Windows language identifiers to locale strings.
  1479. #
  1480. # This list has been updated from
  1481. # http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_238z.asp
  1482. # to include every locale up to Windows Vista.
  1483. #
  1484. # NOTE: this mapping is incomplete. If your language is missing, please
  1485. # submit a bug report to Python bug manager, which you can find via:
  1486. # http://www.python.org/dev/
  1487. # Make sure you include the missing language identifier and the suggested
  1488. # locale code.
  1489. #
  1490. windows_locale = {
  1491. 0x0436: "af_ZA", # Afrikaans
  1492. 0x041c: "sq_AL", # Albanian
  1493. 0x0484: "gsw_FR",# Alsatian - France
  1494. 0x045e: "am_ET", # Amharic - Ethiopia
  1495. 0x0401: "ar_SA", # Arabic - Saudi Arabia
  1496. 0x0801: "ar_IQ", # Arabic - Iraq
  1497. 0x0c01: "ar_EG", # Arabic - Egypt
  1498. 0x1001: "ar_LY", # Arabic - Libya
  1499. 0x1401: "ar_DZ", # Arabic - Algeria
  1500. 0x1801: "ar_MA", # Arabic - Morocco
  1501. 0x1c01: "ar_TN", # Arabic - Tunisia
  1502. 0x2001: "ar_OM", # Arabic - Oman
  1503. 0x2401: "ar_YE", # Arabic - Yemen
  1504. 0x2801: "ar_SY", # Arabic - Syria
  1505. 0x2c01: "ar_JO", # Arabic - Jordan
  1506. 0x3001: "ar_LB", # Arabic - Lebanon
  1507. 0x3401: "ar_KW", # Arabic - Kuwait
  1508. 0x3801: "ar_AE", # Arabic - United Arab Emirates
  1509. 0x3c01: "ar_BH", # Arabic - Bahrain
  1510. 0x4001: "ar_QA", # Arabic - Qatar
  1511. 0x042b: "hy_AM", # Armenian
  1512. 0x044d: "as_IN", # Assamese - India
  1513. 0x042c: "az_AZ", # Azeri - Latin
  1514. 0x082c: "az_AZ", # Azeri - Cyrillic
  1515. 0x046d: "ba_RU", # Bashkir
  1516. 0x042d: "eu_ES", # Basque - Russia
  1517. 0x0423: "be_BY", # Belarusian
  1518. 0x0445: "bn_IN", # Begali
  1519. 0x201a: "bs_BA", # Bosnian - Cyrillic
  1520. 0x141a: "bs_BA", # Bosnian - Latin
  1521. 0x047e: "br_FR", # Breton - France
  1522. 0x0402: "bg_BG", # Bulgarian
  1523. # 0x0455: "my_MM", # Burmese - Not supported
  1524. 0x0403: "ca_ES", # Catalan
  1525. 0x0004: "zh_CHS",# Chinese - Simplified
  1526. 0x0404: "zh_TW", # Chinese - Taiwan
  1527. 0x0804: "zh_CN", # Chinese - PRC
  1528. 0x0c04: "zh_HK", # Chinese - Hong Kong S.A.R.
  1529. 0x1004: "zh_SG", # Chinese - Singapore
  1530. 0x1404: "zh_MO", # Chinese - Macao S.A.R.
  1531. 0x7c04: "zh_CHT",# Chinese - Traditional
  1532. 0x0483: "co_FR", # Corsican - France
  1533. 0x041a: "hr_HR", # Croatian
  1534. 0x101a: "hr_BA", # Croatian - Bosnia
  1535. 0x0405: "cs_CZ", # Czech
  1536. 0x0406: "da_DK", # Danish
  1537. 0x048c: "gbz_AF",# Dari - Afghanistan
  1538. 0x0465: "div_MV",# Divehi - Maldives
  1539. 0x0413: "nl_NL", # Dutch - The Netherlands
  1540. 0x0813: "nl_BE", # Dutch - Belgium
  1541. 0x0409: "en_US", # English - United States
  1542. 0x0809: "en_GB", # English - United Kingdom
  1543. 0x0c09: "en_AU", # English - Australia
  1544. 0x1009: "en_CA", # English - Canada
  1545. 0x1409: "en_NZ", # English - New Zealand
  1546. 0x1809: "en_IE", # English - Ireland
  1547. 0x1c09: "en_ZA", # English - South Africa
  1548. 0x2009: "en_JA", # English - Jamaica
  1549. 0x2409: "en_CB", # English - Carribbean
  1550. 0x2809: "en_BZ", # English - Belize
  1551. 0x2c09: "en_TT", # English - Trinidad
  1552. 0x3009: "en_ZW", # English - Zimbabwe
  1553. 0x3409: "en_PH", # English - Philippines
  1554. 0x4009: "en_IN", # English - India
  1555. 0x4409: "en_MY", # English - Malaysia
  1556. 0x4809: "en_IN", # English - Singapore
  1557. 0x0425: "et_EE", # Estonian
  1558. 0x0438: "fo_FO", # Faroese
  1559. 0x0464: "fil_PH",# Filipino
  1560. 0x040b: "fi_FI", # Finnish
  1561. 0x040c: "fr_FR", # French - France
  1562. 0x080c: "fr_BE", # French - Belgium
  1563. 0x0c0c: "fr_CA", # French - Canada
  1564. 0x100c: "fr_CH", # French - Switzerland
  1565. 0x140c: "fr_LU", # French - Luxembourg
  1566. 0x180c: "fr_MC", # French - Monaco
  1567. 0x0462: "fy_NL", # Frisian - Netherlands
  1568. 0x0456: "gl_ES", # Galician
  1569. 0x0437: "ka_GE", # Georgian
  1570. 0x0407: "de_DE", # German - Germany
  1571. 0x0807: "de_CH", # German - Switzerland
  1572. 0x0c07: "de_AT", # German - Austria
  1573. 0x1007: "de_LU", # German - Luxembourg
  1574. 0x1407: "de_LI", # German - Liechtenstein
  1575. 0x0408: "el_GR", # Greek
  1576. 0x046f: "kl_GL", # Greenlandic - Greenland
  1577. 0x0447: "gu_IN", # Gujarati
  1578. 0x0468: "ha_NG", # Hausa - Latin
  1579. 0x040d: "he_IL", # Hebrew
  1580. 0x0439: "hi_IN", # Hindi
  1581. 0x040e: "hu_HU", # Hungarian
  1582. 0x040f: "is_IS", # Icelandic
  1583. 0x0421: "id_ID", # Indonesian
  1584. 0x045d: "iu_CA", # Inuktitut - Syllabics
  1585. 0x085d: "iu_CA", # Inuktitut - Latin
  1586. 0x083c: "ga_IE", # Irish - Ireland
  1587. 0x0410: "it_IT", # Italian - Italy
  1588. 0x0810: "it_CH", # Italian - Switzerland
  1589. 0x0411: "ja_JP", # Japanese
  1590. 0x044b: "kn_IN", # Kannada - India
  1591. 0x043f: "kk_KZ", # Kazakh
  1592. 0x0453: "kh_KH", # Khmer - Cambodia
  1593. 0x0486: "qut_GT",# K'iche - Guatemala
  1594. 0x0487: "rw_RW", # Kinyarwanda - Rwanda
  1595. 0x0457: "kok_IN",# Konkani
  1596. 0x0412: "ko_KR", # Korean
  1597. 0x0440: "ky_KG", # Kyrgyz
  1598. 0x0454: "lo_LA", # Lao - Lao PDR
  1599. 0x0426: "lv_LV", # Latvian
  1600. 0x0427: "lt_LT", # Lithuanian
  1601. 0x082e: "dsb_DE",# Lower Sorbian - Germany
  1602. 0x046e: "lb_LU", # Luxembourgish
  1603. 0x042f: "mk_MK", # FYROM Macedonian
  1604. 0x043e: "ms_MY", # Malay - Malaysia
  1605. 0x083e: "ms_BN", # Malay - Brunei Darussalam
  1606. 0x044c: "ml_IN", # Malayalam - India
  1607. 0x043a: "mt_MT", # Maltese
  1608. 0x0481: "mi_NZ", # Maori
  1609. 0x047a: "arn_CL",# Mapudungun
  1610. 0x044e: "mr_IN", # Marathi
  1611. 0x047c: "moh_CA",# Mohawk - Canada
  1612. 0x0450: "mn_MN", # Mongolian - Cyrillic
  1613. 0x0850: "mn_CN", # Mongolian - PRC
  1614. 0x0461: "ne_NP", # Nepali
  1615. 0x0414: "nb_NO", # Norwegian - Bokmal
  1616. 0x0814: "nn_NO", # Norwegian - Nynorsk
  1617. 0x0482: "oc_FR", # Occitan - France
  1618. 0x0448: "or_IN", # Oriya - India
  1619. 0x0463: "ps_AF", # Pashto - Afghanistan
  1620. 0x0429: "fa_IR", # Persian
  1621. 0x0415: "pl_PL", # Polish
  1622. 0x0416: "pt_BR", # Portuguese - Brazil
  1623. 0x0816: "pt_PT", # Portuguese - Portugal
  1624. 0x0446: "pa_IN", # Punjabi
  1625. 0x046b: "quz_BO",# Quechua (Bolivia)
  1626. 0x086b: "quz_EC",# Quechua (Ecuador)
  1627. 0x0c6b: "quz_PE",# Quechua (Peru)
  1628. 0x0418: "ro_RO", # Romanian - Romania
  1629. 0x0417: "rm_CH", # Romansh
  1630. 0x0419: "ru_RU", # Russian
  1631. 0x243b: "smn_FI",# Sami Finland
  1632. 0x103b: "smj_NO",# Sami Norway
  1633. 0x143b: "smj_SE",# Sami Sweden
  1634. 0x043b: "se_NO", # Sami Northern Norway
  1635. 0x083b: "se_SE", # Sami Northern Sweden
  1636. 0x0c3b: "se_FI", # Sami Northern Finland
  1637. 0x203b: "sms_FI",# Sami Skolt
  1638. 0x183b: "sma_NO",# Sami Southern Norway
  1639. 0x1c3b: "sma_SE",# Sami Southern Sweden
  1640. 0x044f: "sa_IN", # Sanskrit
  1641. 0x0c1a: "sr_SP", # Serbian - Cyrillic
  1642. 0x1c1a: "sr_BA", # Serbian - Bosnia Cyrillic
  1643. 0x081a: "sr_SP", # Serbian - Latin
  1644. 0x181a: "sr_BA", # Serbian - Bosnia Latin
  1645. 0x045b: "si_LK", # Sinhala - Sri Lanka
  1646. 0x046c: "ns_ZA", # Northern Sotho
  1647. 0x0432: "tn_ZA", # Setswana - Southern Africa
  1648. 0x041b: "sk_SK", # Slovak
  1649. 0x0424: "sl_SI", # Slovenian
  1650. 0x040a: "es_ES", # Spanish - Spain
  1651. 0x080a: "es_MX", # Spanish - Mexico
  1652. 0x0c0a: "es_ES", # Spanish - Spain (Modern)
  1653. 0x100a: "es_GT", # Spanish - Guatemala
  1654. 0x140a: "es_CR", # Spanish - Costa Rica
  1655. 0x180a: "es_PA", # Spanish - Panama
  1656. 0x1c0a: "es_DO", # Spanish - Dominican Republic
  1657. 0x200a: "es_VE", # Spanish - Venezuela
  1658. 0x240a: "es_CO", # Spanish - Colombia
  1659. 0x280a: "es_PE", # Spanish - Peru
  1660. 0x2c0a: "es_AR", # Spanish - Argentina
  1661. 0x300a: "es_EC", # Spanish - Ecuador
  1662. 0x340a: "es_CL", # Spanish - Chile
  1663. 0x380a: "es_UR", # Spanish - Uruguay
  1664. 0x3c0a: "es_PY", # Spanish - Paraguay
  1665. 0x400a: "es_BO", # Spanish - Bolivia
  1666. 0x440a: "es_SV", # Spanish - El Salvador
  1667. 0x480a: "es_HN", # Spanish - Honduras
  1668. 0x4c0a: "es_NI", # Spanish - Nicaragua
  1669. 0x500a: "es_PR", # Spanish - Puerto Rico
  1670. 0x540a: "es_US", # Spanish - United States
  1671. # 0x0430: "", # Sutu - Not supported
  1672. 0x0441: "sw_KE", # Swahili
  1673. 0x041d: "sv_SE", # Swedish - Sweden
  1674. 0x081d: "sv_FI", # Swedish - Finland
  1675. 0x045a: "syr_SY",# Syriac
  1676. 0x0428: "tg_TJ", # Tajik - Cyrillic
  1677. 0x085f: "tmz_DZ",# Tamazight - Latin
  1678. 0x0449: "ta_IN", # Tamil
  1679. 0x0444: "tt_RU", # Tatar
  1680. 0x044a: "te_IN", # Telugu
  1681. 0x041e: "th_TH", # Thai
  1682. 0x0851: "bo_BT", # Tibetan - Bhutan
  1683. 0x0451: "bo_CN", # Tibetan - PRC
  1684. 0x041f: "tr_TR", # Turkish
  1685. 0x0442: "tk_TM", # Turkmen - Cyrillic
  1686. 0x0480: "ug_CN", # Uighur - Arabic
  1687. 0x0422: "uk_UA", # Ukrainian
  1688. 0x042e: "wen_DE",# Upper Sorbian - Germany
  1689. 0x0420: "ur_PK", # Urdu
  1690. 0x0820: "ur_IN", # Urdu - India
  1691. 0x0443: "uz_UZ", # Uzbek - Latin
  1692. 0x0843: "uz_UZ", # Uzbek - Cyrillic
  1693. 0x042a: "vi_VN", # Vietnamese
  1694. 0x0452: "cy_GB", # Welsh
  1695. 0x0488: "wo_SN", # Wolof - Senegal
  1696. 0x0434: "xh_ZA", # Xhosa - South Africa
  1697. 0x0485: "sah_RU",# Yakut - Cyrillic
  1698. 0x0478: "ii_CN", # Yi - PRC
  1699. 0x046a: "yo_NG", # Yoruba - Nigeria
  1700. 0x0435: "zu_ZA", # Zulu
  1701. }
  1702. def _print_locale():
  1703. """ Test function.
  1704. """
  1705. categories = {}
  1706. def _init_categories(categories=categories):
  1707. for k,v in globals().items():
  1708. if k[:3] == 'LC_':
  1709. categories[k] = v
  1710. _init_categories()
  1711. del categories['LC_ALL']
  1712. print 'Locale defaults as determined by getdefaultlocale():'
  1713. print '-'*72
  1714. lang, enc = getdefaultlocale()
  1715. print 'Language: ', lang or '(undefined)'
  1716. print 'Encoding: ', enc or '(undefined)'
  1717. print
  1718. print 'Locale settings on startup:'
  1719. print '-'*72
  1720. for name,category in categories.items():
  1721. print name, '...'
  1722. lang, enc = getlocale(category)
  1723. print ' Language: ', lang or '(undefined)'
  1724. print ' Encoding: ', enc or '(undefined)'
  1725. print
  1726. print
  1727. print 'Locale settings after calling resetlocale():'
  1728. print '-'*72
  1729. resetlocale()
  1730. for name,category in categories.items():
  1731. print name, '...'
  1732. lang, enc = getlocale(category)
  1733. print ' Language: ', lang or '(undefined)'
  1734. print ' Encoding: ', enc or '(undefined)'
  1735. print
  1736. try:
  1737. setlocale(LC_ALL, "")
  1738. except:
  1739. print 'NOTE:'
  1740. print 'setlocale(LC_ALL, "") does not support the default locale'
  1741. print 'given in the OS environment variables.'
  1742. else:
  1743. print
  1744. print 'Locale settings after calling setlocale(LC_ALL, ""):'
  1745. print '-'*72
  1746. for name,category in categories.items():
  1747. print name, '...'
  1748. lang, enc = getlocale(category)
  1749. print ' Language: ', lang or '(undefined)'
  1750. print ' Encoding: ', enc or '(undefined)'
  1751. print
  1752. ###
  1753. try:
  1754. LC_MESSAGES
  1755. except NameError:
  1756. pass
  1757. else:
  1758. __all__.append("LC_MESSAGES")
  1759. if __name__=='__main__':
  1760. print 'Locale aliasing:'
  1761. print
  1762. _print_locale()
  1763. print
  1764. print 'Number formatting:'
  1765. print
  1766. _test()