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

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


��Qc@s�dZddlZddlZejZdd�Zdejfd��YZdejfd��YZd	ej	fd
��YZ	dej
fd��YZ
d
�ZdS(s� Python 'utf-16' Codec


Written by Marc-Andre Lemburg ([email protected]).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

i�NtstrictcCstj||t�S(N(tcodecst
utf_16_decodetTrue(tinputterrors((s&/sys/lib/python2.7/encodings/utf_16.pytdecodestIncrementalEncodercBs;eZdd�Zed�Zd�Zd�Zd�ZRS(RcCs tjj||�d|_dS(N(RRt__init__tNonetencoder(tselfR((s&/sys/lib/python2.7/encodings/utf_16.pyRscCsm|jdkrVtj||j�d}tjdkrFtj|_ntj|_|S|j||j�dS(Nitlittle(	R
R	Rt
utf_16_encodeRtsyst	byteordertutf_16_le_encodetutf_16_be_encode(RRtfinaltresult((s&/sys/lib/python2.7/encodings/utf_16.pytencodescCstjj|�d|_dS(N(RRtresetR	R
(R((s&/sys/lib/python2.7/encodings/utf_16.pyR!scCs|jdkrdSdS(Nii(R
R	(R((s&/sys/lib/python2.7/encodings/utf_16.pytgetstate%scCs@|rd|_n*tjdkr0tj|_ntj|_dS(NR(R	R
RRRRR(Rtstate((s&/sys/lib/python2.7/encodings/utf_16.pytsetstate,s
(t__name__t
__module__RtFalseRRRR(((s&/sys/lib/python2.7/encodings/utf_16.pyRs

		tIncrementalDecodercBs&eZdd�Zd�Zd�ZRS(RcCs tjj||�d|_dS(N(RtBufferedIncrementalDecoderRR	tdecoder(RR((s&/sys/lib/python2.7/encodings/utf_16.pyR6scCs�|jdkr�tj||d|�\}}}|dkrKtj|_n6|dkrftj|_n|dkr�td��n||fS|j||j|�S(Nii�iis%UTF-16 stream does not start with BOM(RR	Rtutf_16_ex_decodetutf_16_le_decodetutf_16_be_decodetUnicodeErrorR(RRRRtoutputtconsumedR((s&/sys/lib/python2.7/encodings/utf_16.pyt_buffer_decode:s!
cCstjj|�d|_dS(N(RRRR	R(R((s&/sys/lib/python2.7/encodings/utf_16.pyRGs(RRRR%R(((s&/sys/lib/python2.7/encodings/utf_16.pyR5s	
tStreamWritercBs)eZdd�Zd�Zdd�ZRS(RcCs#tjj|||�d|_dS(N(RR&RR	R
(RtstreamR((s&/sys/lib/python2.7/encodings/utf_16.pyRLscCstjj|�d|_dS(N(RR&RR	R
(R((s&/sys/lib/python2.7/encodings/utf_16.pyRPscCsc|jdkrOtj||�}tjdkr?tj|_ntj|_|S|j||�SdS(NR(R
R	RR
RRRR(RRRR((s&/sys/lib/python2.7/encodings/utf_16.pyRTs(RRRRR(((s&/sys/lib/python2.7/encodings/utf_16.pyR&Ks	tStreamReadercBseZd�Zdd�ZRS(cCs2tjj|�y
|`Wntk
r-nXdS(N(RR(RRtAttributeError(R((s&/sys/lib/python2.7/encodings/utf_16.pyRas


RcCsytj||dt�\}}}|dkr<tj|_n3|dkrWtj|_n|dkrotd�n||fS(Nii�iis%UTF-16 stream does not start with BOM(RRRR RR!R"(RRRtobjectR$R((s&/sys/lib/python2.7/encodings/utf_16.pyRhs!(RRRR(((s&/sys/lib/python2.7/encodings/utf_16.pyR(_s	cCs4tjdddtdtdtdtdtdt�S(	Ntnamesutf-16RRtincrementalencodertincrementaldecodertstreamreadertstreamwriter(Rt	CodecInfoRRRRR(R&(((s&/sys/lib/python2.7/encodings/utf_16.pytgetregentryus	(t__doc__RRR
RRRRRR&R(R1(((s&/sys/lib/python2.7/encodings/utf_16.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 [email protected].