Function: text.decode

Decodes given data to string, assuming the specified character set.

Each byte that cannot be correctly decoded using the specified charset is represented in the output by the \uFFFD codepoint.

Arguments

Arguments
data

bytes

The input to be decoded.

charset

string

The IANA charset name; e.g. UTF-8, US-ASCII, ISO-8859-2. Case-insensitive. Default: UTF-8.

Returns

The decoded text.

Raised exceptions

Exceptions
ValueError If the charset is unsupported.