PATH:
usr
/
lib64
/
python2.7
/
encodings
""" Standard "encodings" Package Standard Python encoding modules are stored in this package directory. Codec modules must have names corresponding to normalized encoding names as defined in the normalize_encoding() function below, e.g. 'utf-8' must be implemented by the module 'utf_8.py'. Each codec module must export the following interface: * getregentry() -> codecs.CodecInfo object The getregentry() API must a CodecInfo object with encoder, decoder, incrementalencoder, incrementaldecoder, streamwriter and streamreader atttributes which adhere to the Python Codec Interface Standard. In addition, a module may optionally also define the following APIs which are then used by the package's codec search function: * getaliases() -> sequence of encoding name strings to use as aliases Alias names returned by getaliases() must be normalized encoding names as defined by normalize_encoding(). Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import codecs from encodings import aliases import __builtin__ _cache = {} _unknown = '--unknown--' _import_tail = ['*'] _norm_encoding_map = (' . ' '0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ ' ' abcdefghijklmnopqrstuvwxyz ' ' ' ' ' ' ') _aliases = aliases.aliases class CodecRegistryError(LookupError, SystemError): pass def normalize_encoding(encoding): """ Normalize an encoding name. Normalization works as follows: all non-alphanumeric characters except the dot used for Python package names are collapsed and replaced with a single underscore, e.g. ' -;#' becomes '_'. Leading and trailing underscores are removed. Note that encoding names should be ASCII only; if they do use non-ASCII characters, these must be Latin-1 compatible. """ # Make sure we have an 8-bit string, because .translate() works # differently for Unicode strings. if hasattr(__builtin__, "unicode") and isinstance(encoding, unicode): # Note that .encode('latin-1') does *not* use the codec # registry, so this call doesn't recurse. (See unicodeobject.c # PyUnicode_AsEncodedString() for details) encoding = encoding.encode('latin-1') return '_'.join(encoding.translate(_norm_encoding_map).split()) def search_function(encoding): # Cache lookup entry = _cache.get(encoding, _unknown) if entry is not _unknown: return entry # Import the module: # # First try to find an alias for the normalized encoding # name and lookup the module using the aliased name, then try to # lookup the module using the standard import scheme, i.e. first # try in the encodings package, then at top-level. # norm_encoding = normalize_encoding(encoding) aliased_encoding = _aliases.get(norm_encoding) or \ _aliases.get(norm_encoding.replace('.', '_')) if aliased_encoding is not None: modnames = [aliased_encoding, norm_encoding] else: modnames = [norm_encoding] for modname in modnames: if not modname or '.' in modname: continue try: # Import is absolute to prevent the possibly malicious import of a # module with side-effects that is not in the 'encodings' package. mod = __import__('encodings.' + modname, fromlist=_import_tail, level=0) except ImportError: pass else: break else: mod = None try: getregentry = mod.getregentry except AttributeError: # Not a codec module mod = None if mod is None: # Cache misses _cache[encoding] = None return None # Now ask the module for the registry entry entry = getregentry() if not isinstance(entry, codecs.CodecInfo): if not 4 <= len(entry) <= 7: raise CodecRegistryError,\ 'module "%s" (%s) failed to register' % \ (mod.__name__, mod.__file__) if not hasattr(entry[0], '__call__') or \ not hasattr(entry[1], '__call__') or \ (entry[2] is not None and not hasattr(entry[2], '__call__')) or \ (entry[3] is not None and not hasattr(entry[3], '__call__')) or \ (len(entry) > 4 and entry[4] is not None and not hasattr(entry[4], '__call__')) or \ (len(entry) > 5 and entry[5] is not None and not hasattr(entry[5], '__call__')): raise CodecRegistryError,\ 'incompatible codecs in module "%s" (%s)' % \ (mod.__name__, mod.__file__) if len(entry)<7 or entry[6] is None: entry += (None,)*(6-len(entry)) + (mod.__name__.split(".", 1)[1],) entry = codecs.CodecInfo(*entry) # Cache the codec registry entry _cache[encoding] = entry # Register its aliases (without overwriting previously registered # aliases) try: codecaliases = mod.getaliases() except AttributeError: pass else: for alias in codecaliases: if alias not in _aliases: _aliases[alias] = modname # Return the registry entry return entry # Register the search_function in the Python codec registry codecs.register(search_function)
[+]
..
[-] iso8859_7.pyo
[edit]
[-] palmos.py
[edit]
[-] iso8859_3.py
[edit]
[-] euc_jisx0213.pyc
[edit]
[-] cp500.pyo
[edit]
[-] cp775.pyc
[edit]
[-] iso2022_jp_2.pyo
[edit]
[-] latin_1.pyc
[edit]
[-] gbk.pyo
[edit]
[-] iso2022_jp_3.pyc
[edit]
[-] cp437.pyo
[edit]
[-] euc_jis_2004.py
[edit]
[-] iso8859_15.py
[edit]
[-] cp1256.py
[edit]
[-] mac_croatian.py
[edit]
[-] cp949.pyo
[edit]
[-] cp1140.pyc
[edit]
[-] raw_unicode_escape.py
[edit]
[-] unicode_escape.py
[edit]
[-] iso8859_8.pyo
[edit]
[-] cp1250.pyo
[edit]
[-] iso2022_jp_1.pyc
[edit]
[-] utf_16.pyc
[edit]
[-] gbk.pyc
[edit]
[-] cp500.pyc
[edit]
[-] johab.pyo
[edit]
[-] utf_32_be.py
[edit]
[-] mac_roman.py
[edit]
[-] iso8859_14.py
[edit]
[-] mac_greek.pyc
[edit]
[-] __init__.pyo
[edit]
[-] cp862.py
[edit]
[-] charmap.py
[edit]
[-] tis_620.pyo
[edit]
[-] euc_kr.pyo
[edit]
[-] iso2022_jp_2004.py
[edit]
[-] iso8859_5.py
[edit]
[-] cp1251.py
[edit]
[-] iso8859_10.py
[edit]
[-] koi8_u.py
[edit]
[-] cp865.pyo
[edit]
[-] hz.py
[edit]
[-] cp037.py
[edit]
[-] euc_jisx0213.py
[edit]
[-] utf_32_le.py
[edit]
[-] cp1026.py
[edit]
[-] cp1256.pyc
[edit]
[-] punycode.pyo
[edit]
[-] iso8859_1.pyc
[edit]
[-] cp949.pyc
[edit]
[-] iso2022_jp_ext.py
[edit]
[-] utf_32_le.pyo
[edit]
[-] big5hkscs.pyo
[edit]
[-] iso8859_11.py
[edit]
[-] latin_1.py
[edit]
[-] hp_roman8.pyo
[edit]
[-] hex_codec.pyo
[edit]
[-] iso8859_1.pyo
[edit]
[-] utf_32.py
[edit]
[-] mac_latin2.pyc
[edit]
[-] iso8859_8.pyc
[edit]
[-] ascii.pyo
[edit]
[-] cp720.pyo
[edit]
[-] cp1006.pyo
[edit]
[-] cp852.pyo
[edit]
[-] quopri_codec.py
[edit]
[-] iso2022_kr.pyc
[edit]
[-] bz2_codec.pyc
[edit]
[-] cp437.pyc
[edit]
[-] iso8859_3.pyc
[edit]
[-] hz.pyo
[edit]
[-] raw_unicode_escape.pyo
[edit]
[-] tis_620.py
[edit]
[-] utf_16_be.pyc
[edit]
[-] cp850.pyc
[edit]
[-] cp950.pyc
[edit]
[-] iso8859_11.pyo
[edit]
[-] cp1257.pyc
[edit]
[-] iso8859_2.pyo
[edit]
[-] cp874.pyo
[edit]
[-] euc_jis_2004.pyc
[edit]
[-] shift_jis.pyc
[edit]
[-] unicode_escape.pyo
[edit]
[-] rot_13.py
[edit]
[-] cp874.py
[edit]
[-] cp874.pyc
[edit]
[-] utf_16_le.pyc
[edit]
[-] cp1257.pyo
[edit]
[-] shift_jis.py
[edit]
[-] cp864.pyc
[edit]
[-] iso8859_2.py
[edit]
[-] gb18030.py
[edit]
[-] cp864.py
[edit]
[-] cp875.py
[edit]
[-] cp932.pyc
[edit]
[-] koi8_r.pyc
[edit]
[-] punycode.pyc
[edit]
[-] cp1254.py
[edit]
[-] string_escape.pyo
[edit]
[-] undefined.py
[edit]
[-] cp1251.pyc
[edit]
[-] iso2022_jp.pyo
[edit]
[-] koi8_r.pyo
[edit]
[-] cp037.pyc
[edit]
[-] iso8859_6.py
[edit]
[-] cp1006.py
[edit]
[-] gb18030.pyo
[edit]
[-] cp860.py
[edit]
[-] mac_latin2.pyo
[edit]
[-] cp862.pyo
[edit]
[-] mac_farsi.py
[edit]
[-] iso8859_15.pyo
[edit]
[-] iso8859_9.pyc
[edit]
[-] hex_codec.py
[edit]
[-] mac_cyrillic.pyc
[edit]
[-] mac_cyrillic.py
[edit]
[-] cp1257.py
[edit]
[-] quopri_codec.pyc
[edit]
[-] ptcp154.py
[edit]
[-] cp949.py
[edit]
[-] iso8859_2.pyc
[edit]
[-] cp424.pyc
[edit]
[-] cp775.pyo
[edit]
[-] cp861.py
[edit]
[-] mac_arabic.py
[edit]
[-] zlib_codec.py
[edit]
[-] iso2022_jp_1.pyo
[edit]
[-] bz2_codec.pyo
[edit]
[-] __init__.pyc
[edit]
[-] ascii.pyc
[edit]
[-] big5.pyo
[edit]
[-] iso8859_8.py
[edit]
[-] gb2312.py
[edit]
[-] palmos.pyo
[edit]
[-] cp875.pyo
[edit]
[-] mac_arabic.pyo
[edit]
[-] cp1252.pyo
[edit]
[-] mac_centeuro.pyc
[edit]
[-] cp1251.pyo
[edit]
[-] cp850.pyo
[edit]
[-] cp1253.pyo
[edit]
[-] cp424.pyo
[edit]
[-] utf_8_sig.py
[edit]
[-] iso8859_4.pyc
[edit]
[-] unicode_internal.pyo
[edit]
[-] cp1026.pyo
[edit]
[-] cp863.pyo
[edit]
[-] gbk.py
[edit]
[-] mac_centeuro.py
[edit]
[-] utf_7.pyo
[edit]
[-] shift_jis_2004.pyo
[edit]
[-] zlib_codec.pyc
[edit]
[-] euc_jis_2004.pyo
[edit]
[-] cp037.pyo
[edit]
[-] big5hkscs.py
[edit]
[-] mac_croatian.pyc
[edit]
[-] mac_iceland.py
[edit]
[-] base64_codec.py
[edit]
[-] iso8859_5.pyc
[edit]
[-] aliases.py
[edit]
[-] undefined.pyc
[edit]
[-] mac_roman.pyo
[edit]
[-] iso8859_7.py
[edit]
[-] utf_16_be.pyo
[edit]
[-] iso8859_15.pyc
[edit]
[-] big5hkscs.pyc
[edit]
[-] latin_1.pyo
[edit]
[-] tis_620.pyc
[edit]
[-] cp424.py
[edit]
[-] mac_turkish.pyc
[edit]
[-] iso2022_jp_3.pyo
[edit]
[-] utf_16_le.py
[edit]
[-] cp437.py
[edit]
[-] iso8859_16.py
[edit]
[-] hz.pyc
[edit]
[-] cp869.pyc
[edit]
[-] gb2312.pyo
[edit]
[-] cp866.py
[edit]
[-] cp852.pyc
[edit]
[-] iso8859_6.pyo
[edit]
[-] euc_kr.py
[edit]
[-] uu_codec.pyc
[edit]
[-] unicode_internal.pyc
[edit]
[-] cp500.py
[edit]
[-] iso2022_jp_3.py
[edit]
[-] mac_centeuro.pyo
[edit]
[-] iso2022_kr.pyo
[edit]
[-] koi8_u.pyc
[edit]
[-] cp1250.py
[edit]
[-] cp869.py
[edit]
[-] shift_jisx0213.py
[edit]
[-] idna.pyc
[edit]
[-] charmap.pyc
[edit]
[-] utf_8.py
[edit]
[-] iso8859_10.pyo
[edit]
[-] cp737.py
[edit]
[-] gb18030.pyc
[edit]
[-] cp855.pyo
[edit]
[-] base64_codec.pyo
[edit]
[-] cp850.py
[edit]
[-] cp1255.pyo
[edit]
[-] iso2022_jp_1.py
[edit]
[-] utf_16_le.pyo
[edit]
[-] cp1254.pyo
[edit]
[-] euc_jp.pyo
[edit]
[-] string_escape.pyc
[edit]
[-] iso8859_11.pyc
[edit]
[-] cp1255.py
[edit]
[-] euc_kr.pyc
[edit]
[-] cp1026.pyc
[edit]
[-] utf_32_be.pyo
[edit]
[-] cp875.pyc
[edit]
[-] cp720.pyc
[edit]
[-] undefined.pyo
[edit]
[-] euc_jisx0213.pyo
[edit]
[-] cp863.py
[edit]
[-] cp858.py
[edit]
[-] utf_8_sig.pyc
[edit]
[-] koi8_r.py
[edit]
[-] iso8859_4.pyo
[edit]
[-] iso8859_13.pyc
[edit]
[-] mac_greek.py
[edit]
[-] cp1254.pyc
[edit]
[-] cp950.pyo
[edit]
[-] cp1253.py
[edit]
[-] cp1253.pyc
[edit]
[-] cp866.pyo
[edit]
[-] cp856.pyo
[edit]
[-] rot_13.pyc
[edit]
[-] shift_jisx0213.pyo
[edit]
[-] mac_iceland.pyc
[edit]
[-] cp861.pyo
[edit]
[-] euc_jp.py
[edit]
[-] punycode.py
[edit]
[-] iso8859_3.pyo
[edit]
[-] big5.pyc
[edit]
[-] ptcp154.pyo
[edit]
[-] mac_farsi.pyc
[edit]
[-] base64_codec.pyc
[edit]
[-] utf_8.pyc
[edit]
[-] ascii.py
[edit]
[-] cp932.py
[edit]
[-] shift_jis_2004.py
[edit]
[-] mac_iceland.pyo
[edit]
[-] johab.pyc
[edit]
[-] iso8859_9.pyo
[edit]
[-] bz2_codec.py
[edit]
[-] utf_7.py
[edit]
[-] cp861.pyc
[edit]
[-] cp855.py
[edit]
[-] unicode_internal.py
[edit]
[-] cp863.pyc
[edit]
[-] cp862.pyc
[edit]
[-] cp855.pyc
[edit]
[-] utf_32.pyo
[edit]
[-] iso8859_6.pyc
[edit]
[-] koi8_u.pyo
[edit]
[-] uu_codec.py
[edit]
[-] utf_16.py
[edit]
[-] hp_roman8.pyc
[edit]
[-] idna.pyo
[edit]
[-] mac_croatian.pyo
[edit]
[-] mac_farsi.pyo
[edit]
[-] iso2022_jp_2004.pyc
[edit]
[-] shift_jis_2004.pyc
[edit]
[-] raw_unicode_escape.pyc
[edit]
[-] iso8859_14.pyo
[edit]
[-] utf_32.pyc
[edit]
[-] mac_romanian.pyc
[edit]
[-] string_escape.py
[edit]
[-] iso8859_5.pyo
[edit]
[-] cp865.pyc
[edit]
[-] rot_13.pyo
[edit]
[-] utf_32_le.pyc
[edit]
[-] iso8859_16.pyc
[edit]
[-] cp1258.py
[edit]
[-] mac_arabic.pyc
[edit]
[-] mbcs.pyo
[edit]
[-] cp950.py
[edit]
[-] cp857.py
[edit]
[-] cp1140.py
[edit]
[-] cp860.pyo
[edit]
[-] cp852.py
[edit]
[-] cp1256.pyo
[edit]
[-] iso8859_10.pyc
[edit]
[-] charmap.pyo
[edit]
[-] hp_roman8.py
[edit]
[-] mac_roman.pyc
[edit]
[-] gb2312.pyc
[edit]
[-] iso8859_13.pyo
[edit]
[-] cp1006.pyc
[edit]
[-] cp864.pyo
[edit]
[-] aliases.pyo
[edit]
[-] iso8859_9.py
[edit]
[-] idna.py
[edit]
[-] __init__.py
[edit]
[-] cp1255.pyc
[edit]
[-] mac_turkish.py
[edit]
[-] shift_jis.pyo
[edit]
[-] palmos.pyc
[edit]
[-] shift_jisx0213.pyc
[edit]
[-] utf_16_be.py
[edit]
[-] cp856.py
[edit]
[-] ptcp154.pyc
[edit]
[-] mac_turkish.pyo
[edit]
[-] cp857.pyo
[edit]
[-] mac_greek.pyo
[edit]
[-] cp720.py
[edit]
[-] iso8859_4.py
[edit]
[-] quopri_codec.pyo
[edit]
[-] mac_cyrillic.pyo
[edit]
[-] cp1258.pyc
[edit]
[-] euc_jp.pyc
[edit]
[-] iso2022_jp_ext.pyo
[edit]
[-] iso8859_13.py
[edit]
[-] mbcs.pyc
[edit]
[-] hex_codec.pyc
[edit]
[-] cp858.pyo
[edit]
[-] unicode_escape.pyc
[edit]
[-] aliases.pyc
[edit]
[-] iso2022_jp_ext.pyc
[edit]
[-] mbcs.py
[edit]
[-] iso2022_jp_2004.pyo
[edit]
[-] johab.py
[edit]
[-] cp775.py
[edit]
[-] iso2022_kr.py
[edit]
[-] iso8859_14.pyc
[edit]
[-] cp856.pyc
[edit]
[-] utf_8_sig.pyo
[edit]
[-] cp1250.pyc
[edit]
[-] uu_codec.pyo
[edit]
[-] mac_romanian.pyo
[edit]
[-] cp737.pyo
[edit]
[-] iso8859_7.pyc
[edit]
[-] big5.py
[edit]
[-] iso8859_16.pyo
[edit]
[-] iso2022_jp.py
[edit]
[-] utf_32_be.pyc
[edit]
[-] iso2022_jp.pyc
[edit]
[-] cp1140.pyo
[edit]
[-] utf_16.pyo
[edit]
[-] utf_8.pyo
[edit]
[-] cp932.pyo
[edit]
[-] iso8859_1.py
[edit]
[-] iso2022_jp_2.py
[edit]
[-] cp857.pyc
[edit]
[-] mac_romanian.py
[edit]
[-] zlib_codec.pyo
[edit]
[-] cp1252.py
[edit]
[-] iso2022_jp_2.pyc
[edit]
[-] cp737.pyc
[edit]
[-] cp858.pyc
[edit]
[-] cp865.py
[edit]
[-] utf_7.pyc
[edit]
[-] cp1252.pyc
[edit]
[-] cp866.pyc
[edit]
[-] cp1258.pyo
[edit]
[-] mac_latin2.py
[edit]
[-] cp869.pyo
[edit]
[-] cp860.pyc
[edit]