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