Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 GøªjS)ã@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.5.1z iso-8859-8z mac-cyrillicz mac-romanÚcp874)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 ú=/tmp/pip-build-_d5lkt3n/webencodings/webencodings/__init__.pyÚ ascii_lower#srcCsxt|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ÚCACHEÚx_user_definedrÚ PYTHON_NAMESÚcodecsÚlookupÚEncoding)ÚlabelÚnameÚencodingrÚ 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)Úencoding_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)r r r r Ú__repr__€szEncoding.__repr__N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r!r"r 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ÚerrorsÚ 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  r9ccs°|j}t|ƒ}xf|D].}||ƒ}|r|jdk s2t‚|jV|VPqW|ddd�}|jdk s`t‚|jV|rr|VdSx|D]}||ƒ}|r||Vq|W|ddd�}|r¬|VdS)zqReturn a generator that first yields the :obj:`Encoding`, then yields output chukns as Unicode strings. NóT)Úfinal)r ÚiterrÚAssertionError)r)r7r ÚchunckÚoutputr r r r5Ös,     r5cCst||ƒ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 rBccs:x|D]}||ƒ}|r|VqW|ddd�}|r6|VdS)NÚT)r;r )r)rr>r?r r r rAs   rAc@s$eZdZdZd dd„Zd dd„ZdS) r4uO “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)Nr:)rÚ_fallback_encodingÚ_errorsÚ_bufferÚ_decoderr)r r*r+r r r r!s  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.rC) rGrFr(ÚlenrDrÚincrementaldecoderrEr r)r r)r;r7rr r r r 's    zIncrementalDecoder.decodeN)r')F)r#r$r%r&r!r r r r r r4s  r4c@seZdZdZedfdd„ZdS)r@uù “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. r3cCst|ƒ}|jj|ƒj|_dS)N)rrÚincrementalencoderr)r rr+r r r r!TszIncrementalEncoder.__init__N)r#r$r%r&r2r!r r r r r@Csr@)r')r')r&Ú __future__rrÚlabelsrÚVERSIONrrrrrÚobjectrr2r0r1r r(rr9r5rBrAr4r@r r r r Ú s2       3