Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/encodings/utf_8_sig.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@s�dZddlZdd�Zdd�Zdejfd��YZdejfd	��YZd
ejfd��YZdejfd
��YZd�Z	dS(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.
i�NtstrictcCs'tjtj||�dt|�fS(Ni(tcodecstBOM_UTF8tutf_8_encodetlen(tinputterrors((s)/sys/lib/python2.7/encodings/utf_8_sig.pytencodescCsUd}|d tjkr,|d}d}ntj||t�\}}|||fS(Nii(RRtutf_8_decodetTrue(RRtprefixtoutputtconsumed((s)/sys/lib/python2.7/encodings/utf_8_sig.pytdecodes
	tIncrementalEncodercBs;eZdd�Zed�Zd�Zd�Zd�ZRS(RcCs tjj||�d|_dS(Ni(RRt__init__tfirst(tselfR((s)/sys/lib/python2.7/encodings/utf_8_sig.pyRscCsK|jr0d|_tjtj||j�dStj||j�dSdS(Ni(RRRRR(RRtfinal((s)/sys/lib/python2.7/encodings/utf_8_sig.pyRs		cCstjj|�d|_dS(Ni(RRtresetR(R((s)/sys/lib/python2.7/encodings/utf_8_sig.pyR%scCs|jS(N(R(R((s)/sys/lib/python2.7/encodings/utf_8_sig.pytgetstate)scCs
||_dS(N(R(Rtstate((s)/sys/lib/python2.7/encodings/utf_8_sig.pytsetstate,s(t__name__t
__module__RtFalseRRRR(((s)/sys/lib/python2.7/encodings/utf_8_sig.pyRs
		tIncrementalDecodercBs&eZdd�Zd�Zd�ZRS(RcCs tjj||�t|_dS(N(RtBufferedIncrementalDecoderRR	R(RR((s)/sys/lib/python2.7/encodings/utf_8_sig.pyR0scCs�|jr�t|�dkr=tjj|�r1dSd|_q�d|_|d tjkr�tj|d||�\}}||dfSntj|||�S(Niui(ui(RRRRt
startswithtNoneR(RRRRRR((s)/sys/lib/python2.7/encodings/utf_8_sig.pyt_buffer_decode4s		cCstjj|�t|_dS(N(RRRR	R(R((s)/sys/lib/python2.7/encodings/utf_8_sig.pyRDs(RRRRR(((s)/sys/lib/python2.7/encodings/utf_8_sig.pyR/s	tStreamWritercBseZd�Zdd�ZRS(cCs2tjj|�y
|`Wntk
r-nXdS(N(RRRRtAttributeError(R((s)/sys/lib/python2.7/encodings/utf_8_sig.pyRIs


RcCstj|_t||�S(N(RRR(RRR((s)/sys/lib/python2.7/encodings/utf_8_sig.pyRPs(RRRR(((s)/sys/lib/python2.7/encodings/utf_8_sig.pyRHs	tStreamReadercBseZd�Zdd�ZRS(cCs2tjj|�y
|`Wntk
r-nXdS(N(RR!RR
R (R((s)/sys/lib/python2.7/encodings/utf_8_sig.pyRUs


RcCs�t|�dkr+tjj|�rtdSnI|d tjkrttj|_tj|d|�\}}||dfStj|_tj||�S(Niui(ui(RRRRRR
(RRRRR((s)/sys/lib/python2.7/encodings/utf_8_sig.pyR
\s(RRRR
(((s)/sys/lib/python2.7/encodings/utf_8_sig.pyR!Ts	cCs4tjdddtdtdtdtdtdt�S(	Ntnames	utf-8-sigRR
tincrementalencodertincrementaldecodertstreamreadertstreamwriter(Rt	CodecInfoRR
RRR!R(((s)/sys/lib/python2.7/encodings/utf_8_sig.pytgetregentryls	(
t__doc__RRR
RRRRR!R((((s)/sys/lib/python2.7/encodings/utf_8_sig.pyt<module>	s

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.