AlkantarClanX12
Current Path : /usr/lib64/python3.6/encodings/__pycache__/ |
Current File : //usr/lib64/python3.6/encodings/__pycache__/utf_16.cpython-36.pyc |
3 \t � @ sx d Z ddlZddlZejZddd�ZG dd� dej�ZG dd � d ej�ZG d d� dej �Z G dd � d ej �Z dd� ZdS )z� Python 'utf-16' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. � N�strictc C s t j| |d�S )NT)�codecs� utf_16_decode)�input�errors� r �(/usr/lib64/python3.6/encodings/utf_16.py�decode s r c @ s8 e Zd Zddd�Zddd�Zdd� Zd d � Zdd� Zd S )�IncrementalEncoderr c C s t jj| |� d | _d S )N)r r �__init__�encoder)�selfr r r r r s zIncrementalEncoder.__init__Fc C sN | j d kr<tj|| j�d }tjdkr0tj| _ ntj| _ |S | j || j�d S )Nr �little)r r � utf_16_encoder �sys� byteorder�utf_16_le_encode�utf_16_be_encode)r r �final�resultr r r �encode s zIncrementalEncoder.encodec C s t jj| � d | _d S )N)r r �resetr )r r r r r ! s zIncrementalEncoder.resetc C s | j d krdS dS )N� r )r )r r r r �getstate% s zIncrementalEncoder.getstatec C s, |rd | _ ntjdkr tj| _ ntj| _ d S )Nr )r r r r r r )r �stater r r �setstate, s zIncrementalEncoder.setstateN)r )F)�__name__� __module__�__qualname__r r r r r r r r r r s r c @ s6 e Zd Zd dd�Zdd� Zdd� Zdd � Zd d� ZdS )�IncrementalDecoderr c C s t jj| |� d | _d S )N)r �BufferedIncrementalDecoderr �decoder)r r r r r r 6 s zIncrementalDecoder.__init__c C sl | j d kr\tj||d|�\}}}|dkr2tj| _ n"|dkrDtj| _ n|dkrTtd��||fS | j || j|�S )Nr � r z%UTF-16 stream does not start with BOM���)r! r �utf_16_ex_decode�utf_16_le_decode�utf_16_be_decode�UnicodeErrorr )r r r r �output�consumedr r r r �_buffer_decode: s z!IncrementalDecoder._buffer_decodec C s t jj| � d | _d S )N)r r r r! )r r r r r G s zIncrementalDecoder.resetc C sD t jj| �d }| jd kr"|dfS ttjdk| jt jkk�}||fS )Nr r �big)r r r r! �intr r r&