Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 ÝPfP)ã@sædZddlmZddlZddlmZdZddd d d œZiZd d „Z dd„Z dd„Z Gdd„de ƒZ e dƒZe dƒZe dƒZd+dd„Zdd„Zedfdd„Zd,dd „Zd!d"„Zedfd#d$„Zd%d&„ZGd'd(„d(e ƒZGd)d*„d*e ƒZdS)-a webencodings ~~~~~~~~~~~~ This is a Python implementation of the `WHATWG Encoding standard `. See README for details. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. é)Úunicode_literalsNé)ÚLABELSz0.5z iso-8859-8z mac-cyrillicz mac-romanZcp874)z iso-8859-8-izx-mac-cyrillicÚ macintoshz windows-874cCs|jdƒjƒjdƒS)a9Transform (only) ASCII letters to lower case: A-Z is mapped to a-z. :param string: An Unicode string. :returns: A new Unicode string. This is used for `ASCII case-insensitive `_ matching of encoding labels. The same matching is also used, among other things, for `CSS keywords `_. This is different from the :meth:`~py:str.lower` method of Unicode strings which also affect non-ASCII characters, sometimes mapping them into the ASCII range: >>> keyword = u'Bac\N{KELVIN SIGN}ground' >>> assert keyword.lower() == u'background' >>> assert ascii_lower(keyword) != keyword.lower() >>> assert ascii_lower(keyword) == u'bac\N{KELVIN SIGN}ground' Úutf8)ÚencodeÚlowerÚdecode)Ústring©r ú/usr/lib/python3.6/__init__.pyÚ ascii_lower#sr cCsxt|jdƒƒ}tj|ƒ}|dkr$dStj|ƒ}|dkrt|dkrLddlm}ntj||ƒ}tj |ƒ}t ||ƒ}|t|<|S)u< Look for an encoding by its label. This is the spec’s `get an encoding `_ algorithm. Supported labels are listed there. :param label: A string. :returns: An :class:`Encoding` object, or :obj:`None` for an unknown label. z Nzx-user-definedr)Ú codec_info) r ÚstriprÚgetÚCACHEZx_user_definedrÚ PYTHON_NAMESÚcodecsÚlookupÚEncoding)ZlabelÚnameÚencodingrZ python_namer r r r=s      rcCs.t|dƒr|St|ƒ}|dkr*td|ƒ‚|S)zç Accept either an encoding object or label. :param encoding: An :class:`Encoding` object or a label string. :returns: An :class:`Encoding` object. :raises: :exc:`~exceptions.LookupError` for an unknown label. rNzUnknown encoding label: %r)ÚhasattrrÚ LookupError)Zencoding_or_labelrr r r Ú _get_encoding[s  rc@s eZdZdZdd„Zdd„ZdS)raOReresents a character encoding such as UTF-8, that can be used for decoding or encoding. .. attribute:: name Canonical name of the encoding .. attribute:: codec_info The actual implementation of the encoding, a stdlib :class:`~codecs.CodecInfo` object. See :func:`codecs.register`. cCs||_||_dS)N)rr)Úselfrrr r r Ú__init__|szEncoding.__init__cCs d|jS)Nz )r)rr r r Ú__repr__€szEncoding.__repr__N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrr r r r rmsrzutf-8zutf-16lezutf-16beÚreplacecCs2t|ƒ}t|ƒ\}}|p|}|jj||ƒd|fS)aÖ Decode a single string. :param input: A byte string :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :return: A ``(output, encoding)`` tuple of an Unicode string and an :obj:`Encoding`. r)rÚ _detect_bomrr )ÚinputÚfallback_encodingÚerrorsZ bom_encodingrr r r r ‹s r cCsV|jdƒrt|dd…fS|jdƒr4t|dd…fS|jdƒrNt|dd…fSd|fS)zBReturn (bom_encoding, input), with any BOM removed from the input.sÿþéNsþÿsé)Ú startswithÚ_UTF16LEÚ_UTF16BEÚUTF8)r$r r r r#¡s   r#ÚstrictcCst|ƒjj||ƒdS)a; Encode a single string. :param input: An Unicode string. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :return: A byte string. r)rrr)r$rr&r r r r¬s rcCs$t||ƒ}t||ƒ}t|ƒ}||fS)aâ "Pull"-based decoder. :param input: An iterable of byte strings. The input is first consumed just enough to determine the encoding based on the precense of a BOM, then consumed on demand when the return value is. :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :returns: An ``(output, encoding)`` tuple. :obj:`output` is an iterable of Unicode strings, :obj:`encoding` is the :obj:`Encoding` that is being used. )ÚIncrementalDecoderÚ_iter_decode_generatorÚnext)r$r%r&ÚdecoderÚ generatorrr r r Ú iter_decodeºs  r3ccs”|j}t|ƒ}xJ|D] }||ƒ}|r|jV|VPqW|ddd�}|jV|rV|VdSx|D]}||ƒ}|r`|Vq`W|ddd�}|r�|VdS)zqReturn a generator that first yields the :obj:`Encoding`, then yields output chukns as Unicode strings. óT)ÚfinalN)r Úiterr)r$r1r ÚchunckÚoutputr r r r/Ös(     r/cCst||ƒj}t||ƒS)uY “Pullâ€�-based encoder. :param input: An iterable of Unicode strings. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. :returns: An iterable of byte strings. )ÚIncrementalEncoderrÚ_iter_encode_generator)r$rr&rr r r Ú iter_encodeös r;ccs:x|D]}||ƒ}|r|VqW|ddd�}|r6|VdS)NÚT)r5r )r$rr7r8r r r r:s   r:c@s$eZdZdZd dd„Zd dd„ZdS) r.uO “Pushâ€�-based decoder. :param fallback_encoding: An :class:`Encoding` object or a label string. The encoding to use if :obj:`input` does note have a BOM. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. r"cCs&t|ƒ|_||_d|_d|_d|_dS)Nr4)rÚ_fallback_encodingÚ_errorsÚ_bufferÚ_decoderr)rr%r&r r r rs  zIncrementalDecoder.__init__FcCs~|j}|dk r|||ƒS|j|}t|ƒ\}}|dkrXt|ƒdkrR| rR||_dS|j}|jj|jƒj}||_||_ |||ƒS)zùDecode one chunk of the input. :param input: A byte string. :param final: Indicate that no more input is available. Must be :obj:`True` if this is the last call. :returns: An Unicode string. Nr(r<) r@r?r#Úlenr=rÚincrementaldecoderr>r r)rr$r5r1rr r r r 's    zIncrementalDecoder.decodeN)r")F)rrr r!rr r r r r r.s  r.c@seZdZdZedfdd„ZdS)r9uù “Pushâ€�-based encoder. :param encoding: An :class:`Encoding` object or a label string. :param errors: Type of error handling. See :func:`codecs.register`. :raises: :exc:`~exceptions.LookupError` for an unknown encoding label. .. method:: encode(input, final=False) :param input: An Unicode string. :param final: Indicate that no more input is available. Must be :obj:`True` if this is the last call. :returns: A byte string. r-cCst|ƒ}|jj|ƒj|_dS)N)rrÚincrementalencoderr)rrr&r r r rTszIncrementalEncoder.__init__N)rrr r!r,rr r r r r9Csr9)r")r")r!Z __future__rrZlabelsrÚVERSIONrrr rrÚobjectrr,r*r+r r#rr3r/r;r:r.r9r r r r Ú s2       3