7ec@sdZddlZddlZejZddZdejfdYZdejfdYZd ej fd YZ d ej fd YZ d Z dS(s Python 'utf-16' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. iNtstrictcCstj||tS(N(tcodecst utf_16_decodetTrue(tinputterrors((s(/usr/lib64/python2.7/encodings/utf_16.pytdecodestIncrementalEncodercBs;eZddZedZdZdZdZRS(RcCs tjj||d|_dS(N(RRt__init__tNonetencoder(tselfR((s(/usr/lib64/python2.7/encodings/utf_16.pyRscCsm|jdkrVtj||jd}tjdkrFtj|_n tj|_|S|j||jdS(Nitlittle( R R Rt utf_16_encodeRtsyst byteordertutf_16_le_encodetutf_16_be_encode(R Rtfinaltresult((s(/usr/lib64/python2.7/encodings/utf_16.pytencodes cCstjj|d|_dS(N(RRtresetR R (R ((s(/usr/lib64/python2.7/encodings/utf_16.pyR!scCs|jdkrdSdS(Nii(R R (R ((s(/usr/lib64/python2.7/encodings/utf_16.pytgetstate%scCs@|rd|_n*tjdkr0tj|_n tj|_dS(NR (R R RRRRR(R tstate((s(/usr/lib64/python2.7/encodings/utf_16.pytsetstate,s  (t__name__t __module__RtFalseRRRR(((s(/usr/lib64/python2.7/encodings/utf_16.pyRs    tIncrementalDecodercBs&eZddZdZdZRS(RcCs tjj||d|_dS(N(RtBufferedIncrementalDecoderRR tdecoder(R R((s(/usr/lib64/python2.7/encodings/utf_16.pyR6scCs|jdkrtj||d|\}}}|dkrKtj|_n6|dkrftj|_n|dkrtdn||fS|j||j|S(Niiiis%UTF-16 stream does not start with BOM(RR Rtutf_16_ex_decodetutf_16_le_decodetutf_16_be_decodet UnicodeErrorR(R RRRtoutputtconsumedR((s(/usr/lib64/python2.7/encodings/utf_16.pyt_buffer_decode:s!    cCstjj|d|_dS(N(RRRR R(R ((s(/usr/lib64/python2.7/encodings/utf_16.pyRGs(RRRR%R(((s(/usr/lib64/python2.7/encodings/utf_16.pyR5s  t StreamWritercBs)eZddZdZddZRS(RcCs#tjj|||d|_dS(N(RR&RR R (R tstreamR((s(/usr/lib64/python2.7/encodings/utf_16.pyRLscCstjj|d|_dS(N(RR&RR R (R ((s(/usr/lib64/python2.7/encodings/utf_16.pyRPscCsc|jdkrOtj||}tjdkr?tj|_n tj|_|S|j||SdS(NR (R R RR RRRR(R RRR((s(/usr/lib64/python2.7/encodings/utf_16.pyRTs (RRRRR(((s(/usr/lib64/python2.7/encodings/utf_16.pyR&Ks  t StreamReadercBseZdZddZRS(cCs2tjj|y |`Wntk r-nXdS(N(RR(RRtAttributeError(R ((s(/usr/lib64/python2.7/encodings/utf_16.pyRas   RcCsytj||dt\}}}|dkr<tj|_n3|dkrWtj|_n|dkrotdn||fS(Niiiis%UTF-16 stream does not start with BOM(RRRR RR!R"(R RRtobjectR$R((s(/usr/lib64/python2.7/encodings/utf_16.pyRhs!    (RRRR(((s(/usr/lib64/python2.7/encodings/utf_16.pyR(_s cCs4tjdddtdtdtdtdtdtS( Ntnamesutf-16RRtincrementalencodertincrementaldecodert streamreadert streamwriter(Rt CodecInfoRRRRR(R&(((s(/usr/lib64/python2.7/encodings/utf_16.pyt getregentryus ( t__doc__RRR RRRRRR&R(R1(((s(/usr/lib64/python2.7/encodings/utf_16.pyts  #