home *** CD-ROM | disk | FTP | other *** search
/ Freelog 33 / Freelog033.iso / Progr / Python-2.2.1.exe / ALIASES.PY < prev    next >
Encoding:
Python Source  |  2001-12-02  |  2.7 KB  |  112 lines

  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-7
  18.     'utf7': 'utf_7',
  19.     'u7': 'utf_7',
  20.     
  21.     # UTF-8
  22.     'utf': 'utf_8',
  23.     'utf8': 'utf_8',
  24.     'u8': 'utf_8',
  25.     'utf8@ucs2': 'utf_8',
  26.     'utf8@ucs4': 'utf_8',
  27.     
  28.     # UTF-16
  29.     'utf16': 'utf_16',
  30.     'u16': 'utf_16',
  31.     'utf_16be': 'utf_16_be',
  32.     'utf_16le': 'utf_16_le',
  33.     'unicodebigunmarked': 'utf_16_be',
  34.     'unicodelittleunmarked': 'utf_16_le',
  35.  
  36.     # ASCII
  37.     'us_ascii': 'ascii',
  38.     'ansi_x3.4_1968': 'ascii', # used on Linux
  39.     '646': 'ascii',            # used on Solaris
  40.  
  41.     # EBCDIC
  42.     'ebcdic_cp_us': 'cp037',
  43.     'ibm039': 'cp037',
  44.     'ibm1140': 'cp1140',
  45.     
  46.     # ISO
  47.     '8859': 'latin_1',
  48.     'iso8859': 'latin_1',
  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
  65.     'maclatin2': 'mac_latin2',
  66.     'maccentraleurope': 'mac_latin2',
  67.     'maccyrillic': 'mac_cyrillic',
  68.     'macgreek': 'mac_greek',
  69.     'maciceland': 'mac_iceland',
  70.     'macroman': 'mac_roman',
  71.     'macturkish': 'mac_turkish',
  72.  
  73.     # Windows
  74.     'windows_1251': 'cp1251',
  75.     'windows_1252': 'cp1252',
  76.     'windows_1254': 'cp1254',
  77.     'windows_1255': 'cp1255',
  78.  
  79.     # MBCS
  80.     'dbcs': 'mbcs',
  81.  
  82.     # Code pages
  83.     '437': 'cp437',
  84.  
  85.     # CJK
  86.     #
  87.     # The codecs for these encodings are not distributed with the
  88.     # Python core, but are included here for reference, since the
  89.     # locale module relies on having these aliases available.
  90.     #
  91.     'jis_7': 'jis_7',
  92.     'iso_2022_jp': 'jis_7',
  93.     'ujis': 'euc_jp',
  94.     'ajec': 'euc_jp',
  95.     'eucjp': 'euc_jp',
  96.     'tis260': 'tactis',
  97.     'sjis': 'shift_jis',
  98.  
  99.     # Content transfer/compression encodings
  100.     'rot13': 'rot_13',
  101.     'base64': 'base64_codec',
  102.     'base_64': 'base64_codec',
  103.     'zlib': 'zlib_codec',
  104.     'zip': 'zlib_codec',
  105.     'hex': 'hex_codec',
  106.     'uu': 'uu_codec',
  107.     'quopri': 'quopri_codec',
  108.     'quotedprintable': 'quopri_codec',
  109.     'quoted_printable': 'quopri_codec',
  110.  
  111. }
  112.