ID EN
Built-in Types

encode

Python 3.11

Return the string encoded to bytes.

Syntax

PYTHON
str.encode(encoding='utf-8', errors='strict')

See Also

bytes Standard Encodings UnicodeError codecs.register_error() Error Handlers Python Development Mode debug build Python Development Mode