Let us walk on the 3-isogeny graph
|
Namespaces | |
namespace | labels |
namespace | mklabels |
namespace | tests |
namespace | x_user_defined |
Data Structures | |
class | Encoding |
class | IncrementalDecoder |
class | IncrementalEncoder |
Functions | |
ascii_lower (string) | |
lookup (label) | |
_get_encoding (encoding_or_label) | |
decode (input, fallback_encoding, errors='replace') | |
_detect_bom (input) | |
encode (input, encoding=UTF8, errors='strict') | |
iter_decode (input, fallback_encoding, errors='replace') | |
_iter_decode_generator (input, decoder) | |
iter_encode (input, encoding=UTF8, errors='strict') | |
_iter_encode_generator (input, encode) | |
Variables | |
str | VERSION = '0.5.1' |
dict | PYTHON_NAMES |
dict | CACHE = {} |
UTF8 = lookup('utf-8') | |
_UTF16LE = lookup('utf-16le') | |
_UTF16BE = lookup('utf-16be') | |
webencodings ~~~~~~~~~~~~ This is a Python implementation of the `WHATWG Encoding standard <http://encoding.spec.whatwg.org/>`. See README for details. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details.
|
protected |
Return (bom_encoding, input), with any BOM removed from the input.
Definition at line 161 of file __init__.py.
References i.
Referenced by pip._vendor.webencodings.decode(), and IncrementalDecoder.decode().
|
protected |
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.
Definition at line 91 of file __init__.py.
References i.
Referenced by IncrementalEncoder.__init__(), pip._vendor.webencodings.decode(), and pip._vendor.webencodings.encode().
|
protected |
Return a generator that first yields the :obj:`Encoding`, then yields output chukns as Unicode strings.
Definition at line 214 of file __init__.py.
References i.
Referenced by pip._vendor.webencodings.iter_decode().
|
protected |
Definition at line 262 of file __init__.py.
Referenced by pip._vendor.webencodings.iter_encode().
ascii_lower | ( | string | ) |
Transform (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 <http://encoding.spec.whatwg.org/#ascii-case-insensitive>`_ matching of encoding labels. The same matching is also used, among other things, for `CSS keywords <http://dev.w3.org/csswg/css-values/#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'
Definition at line 35 of file __init__.py.
References i.
Referenced by pip._vendor.webencodings.lookup().
decode | ( | input, | |
fallback_encoding, | |||
errors = 'replace' |
|||
) |
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`.
Definition at line 139 of file __init__.py.
References pip._vendor.webencodings._detect_bom(), pip._vendor.webencodings._get_encoding(), and i.
encode | ( | input, | |
encoding = UTF8 , |
|||
errors = 'strict' |
|||
) |
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.
Definition at line 172 of file __init__.py.
References pip._vendor.webencodings._get_encoding(), and i.
iter_decode | ( | input, | |
fallback_encoding, | |||
errors = 'replace' |
|||
) |
"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.
Definition at line 186 of file __init__.py.
References pip._vendor.webencodings._iter_decode_generator().
iter_encode | ( | input, | |
encoding = UTF8 , |
|||
errors = 'strict' |
|||
) |
“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.
Definition at line 246 of file __init__.py.
References pip._vendor.webencodings._iter_encode_generator().
lookup | ( | label | ) |
Look for an encoding by its label. This is the spec’s `get an encoding <http://encoding.spec.whatwg.org/#concept-encoding-get>`_ algorithm. Supported labels are listed there. :param label: A string. :returns: An :class:`Encoding` object, or :obj:`None` for an unknown label.
Definition at line 61 of file __init__.py.
References pip._vendor.webencodings.ascii_lower(), and i.
Definition at line 136 of file __init__.py.
Definition at line 135 of file __init__.py.
dict CACHE = {} |
Definition at line 32 of file __init__.py.
dict PYTHON_NAMES |
Definition at line 26 of file __init__.py.
Definition at line 133 of file __init__.py.
str VERSION = '0.5.1' |
Definition at line 22 of file __init__.py.