2biS)SrSSKJr SSKrSSKJr SrSSS S S .r0rS r S r Sr "SS\ 5r \ "S5r\ "S5r\ "S5rS SjrSr\S4SjrS SjrSr\S4SjrSr"SS\ 5r"SS\ 5rg)!z 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-romancp874)z iso-8859-8-izx-mac-cyrillic macintoshz windows-874c^URS5R5RS5$)aTransform (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)encodelowerdecode)strings ړ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_vendor/webencodings/__init__.py ascii_lowerr#s'. == & & ( / / 77c6[URS55n[R"U5nUcg[RU5nUcLUS:XaSSKJn O+[RX5n[R"U5n[X5nU[U'U$)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) rstriprgetCACHEx_user_definedr PYTHON_NAMEScodecslookupEncoding)labelnameencodingr python_names rrr=s  K0 1E ::e D |yyH # # 2&**46K{3JD-d Orcd[US5(aU$[U5nUc[SU-5eU$)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. rzUnknown encoding label: %r)hasattrr LookupError)encoding_or_labelrs r _get_encodingr#[s@ ,//  '(H69JJKK Orc$\rSrSrSrSrSrSrg)rma/Reresents 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`. cXlX lgN)rr)selfrrs r__init__Encoding.__init__|s  $rc SUR-$)Nz )r)r(s r__repr__Encoding.__repr__s**r)rrN)__name__ __module__ __qualname____firstlineno____doc__r)r,__static_attributes__rrrrms %+rrzutf-8zutf-16lezutf-16bec[U5n[U5up0U=(d UnURRX5SU4$)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 )inputfallback_encodingerrors bom_encodingrs rr r sI &&78%e,L00H    % %e 4Q 7 AArcURS5(a [USS4$URS5(a [USS4$URS5(a [USS4$SU4$)zBReturn (bom_encoding, input), with any BOM removed from the input.sNss) startswith_UTF16LE_UTF16BEUTF8)r7s rr6r6sq  $$qr""  $$qr"" ((U12Y ;rstrictcP[U5RRX5S$)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)r#rr )r7rr9s rr r s%  " - - 4 4U CA FFrcJ[X5n[X5n[U5nXE4$)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_generatornext)r7r8r9decoder generatorrs r iter_decoderJs+,!!2;G&u6IIH  rc#r# URn[U5nUH5nU"U5nU(dMURceURv Uv O2 U"SSS9nURceURv U(aUv gUHnU"U5nU(dMUv M U"SSS9nU(aUv gg7f)ziReturn a generator that first yields the :obj:`Encoding`, then yields output chukns as Unicode strings. NrTfinal)r iterr)r7rHr chunckoutputs rrFrFs ^^F KE 6##/ //"" "L  4(+++ L 6LCt $F  s*B7A'B7B7cB[X5Rn[X5$)u= “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)r7rr9r s r iter_encoderTs  1 8 8F !% 00rc#n# UHnU"U5nU(dMUv M U"SSS9nU(aUv gg7f)NTrLr4)r7r rOrPs rrSrSs= 6LBd #F  s55c,\rSrSrSrSSjrSSjrSrg) rEiu3 “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. cZ[U5UlX lSUlSUlSUlg)Nr)r#_fallback_encoding_errors_buffer_decoderr)r(r8r9s rr)IncrementalDecoder.__init__s,"/0A"B    rcFURnUbU"X5$URU-n[U5upAUc)[U5S:aU(dXlgURnUR R UR5RnX0lX@l U"X5$)zDecode 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. r=rV) r\r[r6lenrYrincrementaldecoderrZr r)r(r7rMrHrs rr IncrementalDecoder.decode's--  5( ( u$%e,  5zA~e$ 22%%88FMM  u$$r)r[r\rZrYrNreplace)F)r.r/r0r1r2r)r r3r4rrrErEs  %rrEc&\rSrSrSr\S4SjrSrg)rRiCu “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. rBcn[U5nURRU5RUlgr')r#rincrementalencoderr )r(rr9s rr)IncrementalEncoder.__init__Ts* *))<rls (   !$  84<$+v+0g *  * B,  G8@!%X 1 0%0%fLLr