source: python/trunk/Lib/locale.py@ 779

Last change on this file since 779 was 391, checked in by dmik, 11 years ago

python: Merge vendor 2.7.6 to trunk.

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