home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 April / PCWorld_2001-04_cd.bin / Software / TemaCD / webclean / !!!python!!! / BeOpen-Python-2.0.exe / ALIASES.PY < prev    next >
Encoding:
Python Source  |  2000-09-28  |  2.0 KB  |  83 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-8
  18.     'utf': 'utf_8',
  19.     'utf8': 'utf_8',
  20.     'u8': 'utf_8',
  21.     'utf8@ucs2': 'utf_8',
  22.     'utf8@ucs4': 'utf_8',
  23.     
  24.     # UTF-16
  25.     'utf16': 'utf_16',
  26.     'u16': 'utf_16',
  27.     'utf_16be': 'utf_16_be',
  28.     'utf_16le': 'utf_16_le',
  29.     'unicodebigunmarked': 'utf_16_be',
  30.     'unicodelittleunmarked': 'utf_16_le',
  31.  
  32.     # ASCII
  33.     'us_ascii': 'ascii',
  34.  
  35.     # ISO
  36.     '8859': 'latin_1',
  37.     'iso8859': 'latin_1',
  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
  54.     'maclatin2': 'mac_latin2',
  55.     'maccentraleurope': 'mac_latin2',
  56.     'maccyrillic': 'mac_cyrillic',
  57.     'macgreek': 'mac_greek',
  58.     'maciceland': 'mac_iceland',
  59.     'macroman': 'mac_roman',
  60.     'macturkish': 'mac_turkish',
  61.  
  62.     # MBCS
  63.     'dbcs': 'mbcs',
  64.  
  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.  
  82. }
  83.