Current Path : /usr/lib/python2.7/encodings/ |
Current File : //usr/lib/python2.7/encodings/utf_8_sig.pyc |
|_c @ s d Z d d l Z d d Z d d Z d e j f d YZ d e j f d YZ d e j f d YZ d e j f d YZ d Z d S( s Python 'utf-8-sig' Codec This work similar to UTF-8 with the following changes: * On encoding/writing a UTF-8 encoded BOM will be prepended/written as the first three bytes. * On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these bytes will be skipped. iNt strictc C s' t j t j | | d t | f S( Ni ( t codecst BOM_UTF8t utf_8_encodet len( t inputt errors( ( s) /usr/lib/python2.7/encodings/utf_8_sig.pyt encode s c C sU d } | d t j k r, | d } d } n t j | | t \ } } | | | f S( Ni i ( R R t utf_8_decodet True( R R t prefixt outputt consumed( ( s) /usr/lib/python2.7/encodings/utf_8_sig.pyt decode s t IncrementalEncoderc B s; e Z d d Z e d Z d Z d Z d Z RS( R c C s t j j | | d | _ d S( Ni ( R R t __init__t first( t selfR ( ( s) /usr/lib/python2.7/encodings/utf_8_sig.pyR s c C sK | j r0 d | _ t j t j | | j d St j | | j d Sd S( Ni ( R R R R R ( R R t final( ( s) /usr/lib/python2.7/encodings/utf_8_sig.pyR s c C s t j j | d | _ d S( Ni ( R R t resetR ( R ( ( s) /usr/lib/python2.7/encodings/utf_8_sig.pyR % s c C s | j S( N( R ( R ( ( s) /usr/lib/python2.7/encodings/utf_8_sig.pyt getstate) s c C s | | _ d S( N( R ( R t state( ( s) /usr/lib/python2.7/encodings/utf_8_sig.pyt setstate, s ( t __name__t __module__R t FalseR R R R ( ( ( s) /usr/lib/python2.7/encodings/utf_8_sig.pyR s t IncrementalDecoderc B s&