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 | |
Marc-André Lemburg | c60e6f7 | 2001-09-20 10:35:46 +0000 | [diff] [blame] | 17 | # UTF-7 |
| 18 | 'utf7': 'utf_7', |
| 19 | 'u7': 'utf_7', |
| 20 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 21 | # UTF-8 |
| 22 | 'utf': 'utf_8', |
| 23 | 'utf8': 'utf_8', |
| 24 | 'u8': 'utf_8', |
Marc-André Lemburg | 4fd73f0 | 2000-06-07 09:12:30 +0000 | [diff] [blame] | 25 | 'utf8@ucs2': 'utf_8', |
| 26 | 'utf8@ucs4': 'utf_8', |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 27 | |
| 28 | # UTF-16 |
| 29 | 'utf16': 'utf_16', |
| 30 | 'u16': 'utf_16', |
| 31 | 'utf_16be': 'utf_16_be', |
| 32 | 'utf_16le': 'utf_16_le', |
Guido van Rossum | 68895ed | 2000-03-31 17:23:18 +0000 | [diff] [blame] | 33 | 'unicodebigunmarked': 'utf_16_be', |
| 34 | 'unicodelittleunmarked': 'utf_16_le', |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 35 | |
| 36 | # ASCII |
| 37 | 'us_ascii': 'ascii', |
Martin v. Löwis | 9b75dca | 2001-08-10 13:58:50 +0000 | [diff] [blame] | 38 | 'ansi_x3.4_1968': 'ascii', # used on Linux |
| 39 | '646': 'ascii', # used on Solaris |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 40 | |
Martin v. Löwis | 13b8bc5 | 2001-06-07 19:39:25 +0000 | [diff] [blame] | 41 | # EBCDIC |
| 42 | 'ebcdic_cp_us': 'cp037', |
| 43 | 'ibm039': 'cp037', |
| 44 | 'ibm1140': 'cp1140', |
| 45 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 46 | # ISO |
Marc-André Lemburg | 4fd73f0 | 2000-06-07 09:12:30 +0000 | [diff] [blame] | 47 | '8859': 'latin_1', |
| 48 | 'iso8859': 'latin_1', |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 49 | 'iso8859_1': 'latin_1', |
| 50 | 'iso_8859_1': 'latin_1', |
| 51 | 'iso_8859_10': 'iso8859_10', |
| 52 | 'iso_8859_13': 'iso8859_13', |
| 53 | 'iso_8859_14': 'iso8859_14', |
| 54 | 'iso_8859_15': 'iso8859_15', |
| 55 | 'iso_8859_2': 'iso8859_2', |
| 56 | 'iso_8859_3': 'iso8859_3', |
| 57 | 'iso_8859_4': 'iso8859_4', |
| 58 | 'iso_8859_5': 'iso8859_5', |
| 59 | 'iso_8859_6': 'iso8859_6', |
| 60 | 'iso_8859_7': 'iso8859_7', |
| 61 | 'iso_8859_8': 'iso8859_8', |
| 62 | 'iso_8859_9': 'iso8859_9', |
| 63 | |
| 64 | # Mac |
Marc-André Lemburg | 4fd73f0 | 2000-06-07 09:12:30 +0000 | [diff] [blame] | 65 | 'maclatin2': 'mac_latin2', |
Guido van Rossum | 68895ed | 2000-03-31 17:23:18 +0000 | [diff] [blame] | 66 | 'maccentraleurope': 'mac_latin2', |
| 67 | 'maccyrillic': 'mac_cyrillic', |
| 68 | 'macgreek': 'mac_greek', |
| 69 | 'maciceland': 'mac_iceland', |
| 70 | 'macroman': 'mac_roman', |
| 71 | 'macturkish': 'mac_turkish', |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 72 | |
Mark Hammond | 194bfb2 | 2001-06-04 02:31:23 +0000 | [diff] [blame] | 73 | # Windows |
| 74 | 'windows_1252': 'cp1252', |
| 75 | 'windows_1254': 'cp1254', |
| 76 | 'windows_1255': 'cp1255', |
| 77 | |
Guido van Rossum | 9e896b3 | 2000-04-05 20:11:21 +0000 | [diff] [blame] | 78 | # MBCS |
| 79 | 'dbcs': 'mbcs', |
| 80 | |
Marc-André Lemburg | 4fd73f0 | 2000-06-07 09:12:30 +0000 | [diff] [blame] | 81 | # Code pages |
| 82 | '437': 'cp437', |
| 83 | |
| 84 | # CJK |
| 85 | # |
| 86 | # The codecs for these encodings are not distributed with the |
| 87 | # Python core, but are included here for reference, since the |
| 88 | # locale module relies on having these aliases available. |
| 89 | # |
| 90 | 'jis_7': 'jis_7', |
| 91 | 'iso_2022_jp': 'jis_7', |
| 92 | 'ujis': 'euc_jp', |
| 93 | 'ajec': 'euc_jp', |
| 94 | 'eucjp': 'euc_jp', |
| 95 | 'tis260': 'tactis', |
| 96 | 'sjis': 'shift_jis', |
| 97 | |
Marc-André Lemburg | 2d92041 | 2001-05-15 12:00:02 +0000 | [diff] [blame] | 98 | # Content transfer/compression encodings |
| 99 | 'rot13': 'rot_13', |
| 100 | 'base64': 'base64_codec', |
| 101 | 'base_64': 'base64_codec', |
| 102 | 'zlib': 'zlib_codec', |
| 103 | 'zip': 'zlib_codec', |
| 104 | 'hex': 'hex_codec', |
| 105 | 'uu': 'uu_codec', |
Guido van Rossum | acfdf15 | 2001-05-15 15:34:07 +0000 | [diff] [blame] | 106 | 'quopri': 'quopri_codec', |
| 107 | 'quotedprintable': 'quopri_codec', |
| 108 | 'quoted_printable': 'quopri_codec', |
Marc-André Lemburg | 2d92041 | 2001-05-15 12:00:02 +0000 | [diff] [blame] | 109 | |
Guido van Rossum | 0229bf6 | 2000-03-10 23:17:24 +0000 | [diff] [blame] | 110 | } |