boing.net.bytes
— UNICODE encoding¶The boing.net.bytes
module implements the adapter design
pattern by providing the standard string encoding functionalities as
Encoder and Decoder objects.
boing.net.bytes.
encode
(string, encoding="utf-8", errors="strict")¶Return an encoded version of string as a bytes object. Default encoding is ‘utf-8’. errors may be given to set a different error handling scheme. The default for errors is ‘strict’, meaning that encoding errors raise a UnicodeError. Other possible values are ‘ignore’, ‘replace’, ‘xmlcharrefreplace’, ‘backslashreplace’
boing.net.bytes.
decode
(data, encoding="utf-8", errors="strict")¶Return a string decoded from the given bytes. Default encoding is ‘utf-8’. errors may be given to set a different error handling scheme. The default for errors is ‘strict’, meaning that encoding errors raise a UnicodeError. Other possible values are ‘ignore’, ‘replace’ and any other name registered via codecs.register_error().