On this page
codecs.iterdecode
Prev: codecs.IncrementalEncoder | Up: codecs | Next: codecs.iterencode
Rel: codecs.backslashreplace_errors, codecs.Codec, codecs.CodecInfo, codecs.decode
Ref: docs.python.org — codecs.iterdecode
Tags: #public #python3 #stdlib #codecs
Import
import codecs
from codecs import iterdecode
Signature & Overview
codecs.iterdecode(iterator, encoding, errors='strict', **kwargs)
Decoding iterator.
Usage
import codecs
chunks = [b"caf\xc3", b"\xa9"]
assert "".join(codecs.iterdecode(chunks, "utf-8")) == "café"
Gotchas
- Cleanest way to decode an iterable of byte chunks without splitting multi-byte characters.
REPL Inspect
from codecs import iterdecode
help(iterdecode)
Linked from
Related notes
- tuts/python3/stdlib_module/codecs/IncrementalEncoder Linked here; links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/iterencode Linked here; links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/codecs/backslashreplace_errors Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/Codec Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/CodecInfo Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/decode Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/encode shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/EncodedFile shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/getdecoder shared tags: #codecs, #stdlib