String Encoding - kombu.utils.encoding

kombu.utils.encoding

Utilities to encode text, and to safely emit text from running applications without crashing with the infamous UnicodeDecodeError exception.

kombu.utils.encoding.bytes_to_str(s)[source]
kombu.utils.encoding.default_encode(obj, file=None)[source]
kombu.utils.encoding.default_encoding(file=None)[source]
kombu.utils.encoding.default_encoding_file = None

safe_str takes encoding from this file by default. set_default_encoding_file() can used to set the default output file.

kombu.utils.encoding.ensure_bytes(s)[source]
kombu.utils.encoding.from_utf8(s, *args, **kwargs)[source]
kombu.utils.encoding.get_default_encoding_file()[source]
kombu.utils.encoding.safe_repr(o, errors='replace')[source]
kombu.utils.encoding.safe_str(s, errors='replace')[source]
kombu.utils.encoding.set_default_encoding_file(file)[source]
kombu.utils.encoding.str_to_bytes(s)[source]