Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 1 | """ Encoding Aliases Support |
| 2 | |
| 3 | This module is used by the encodings package search function to |
| 4 | map encodings names to module names. |
| 5 | |
| 6 | Note that the search function converts the encoding names to lower |
| 7 | case and replaces hyphens with underscores *before* performing the |
| 8 | lookup. |
| 9 | |
| 10 | """ |
| 11 | aliases = { |
| 12 | |
| 13 | # Latin-1 |
| 14 | 'latin': 'latin_1', |
| 15 | 'latin1': 'latin_1', |
| 16 | |
| 17 | # UTF-8 |
| 18 | 'utf': 'utf_8', |
| 19 | 'utf8': 'utf_8', |
| 20 | 'u8': 'utf_8', |
Marc-André Lemburg | 4fd73f0 | 2000-06-07 09:12:30 +0000 | [diff] [blame] | 21 | 'utf8@ucs2': 'utf_8', |
| 22 | 'utf8@ucs4': 'utf_8', |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 23 | |
| 24 | # UTF-16 |
| 25 | 'utf16': 'utf_16', |
| 26 | 'u16': 'utf_16', |
| 27 | 'utf_16be': 'utf_16_be', |
| 28 | 'utf_16le': 'utf_16_le', |
Guido van Rossum | 68895ed | 2000-03-31 17:23:18 +0000 | [diff] [blame] | 29 | 'unicodebigunmarked': 'utf_16_be', |
| 30 | 'unicodelittleunmarked': 'utf_16_le', |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 31 | |
| 32 | # ASCII |
| 33 | 'us_ascii': 'ascii', |
| 34 | |
| 35 | # ISO |
Marc-André Lemburg | 4fd73f0 | 2000-06-07 09:12:30 +0000 | [diff] [blame] | 36 | '8859': 'latin_1', |
| 37 | 'iso8859': 'latin_1', |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 38 | 'iso8859_1': 'latin_1', |
| 39 | 'iso_8859_1': 'latin_1', |
| 40 | 'iso_8859_10': 'iso8859_10', |
| 41 | 'iso_8859_13': 'iso8859_13', |
| 42 | 'iso_8859_14': 'iso8859_14', |
| 43 | 'iso_8859_15': 'iso8859_15', |
| 44 | 'iso_8859_2': 'iso8859_2', |
| 45 | 'iso_8859_3': 'iso8859_3', |
| 46 | 'iso_8859_4': 'iso8859_4', |
| 47 | 'iso_8859_5': 'iso8859_5', |
| 48 | 'iso_8859_6': 'iso8859_6', |
| 49 | 'iso_8859_7': 'iso8859_7', |
| 50 | 'iso_8859_8': 'iso8859_8', |
| 51 | 'iso_8859_9': 'iso8859_9', |
| 52 | |
| 53 | # Mac |
Marc-André Lemburg | 4fd73f0 | 2000-06-07 09:12:30 +0000 | [diff] [blame] | 54 | 'maclatin2': 'mac_latin2', |
Guido van Rossum | 68895ed | 2000-03-31 17:23:18 +0000 | [diff] [blame] | 55 | 'maccentraleurope': 'mac_latin2', |
| 56 | 'maccyrillic': 'mac_cyrillic', |
| 57 | 'macgreek': 'mac_greek', |
| 58 | 'maciceland': 'mac_iceland', |
| 59 | 'macroman': 'mac_roman', |
| 60 | 'macturkish': 'mac_turkish', |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 61 | |
Guido van Rossum | 9e896b3 | 2000-04-05 20:11:21 +0000 | [diff] [blame] | 62 | # MBCS |
| 63 | 'dbcs': 'mbcs', |
| 64 | |
Marc-André Lemburg | 4fd73f0 | 2000-06-07 09:12:30 +0000 | [diff] [blame] | 65 | # Code pages |
| 66 | '437': 'cp437', |
| 67 | |
| 68 | # CJK |
| 69 | # |
| 70 | # The codecs for these encodings are not distributed with the |
| 71 | # Python core, but are included here for reference, since the |
| 72 | # locale module relies on having these aliases available. |
| 73 | # |
| 74 | 'jis_7': 'jis_7', |
| 75 | 'iso_2022_jp': 'jis_7', |
| 76 | 'ujis': 'euc_jp', |
| 77 | 'ajec': 'euc_jp', |
| 78 | 'eucjp': 'euc_jp', |
| 79 | 'tis260': 'tactis', |
| 80 | 'sjis': 'shift_jis', |
| 81 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 82 | } |