bytes_to_text
Convert bytes objects to strings, using the given encoding. Illegally encoded input characters are replaced with Unicode "unknown" codepoint (\ufffd).
Return any non-bytes objects without change.
def bytes_to_text(
s: any,
encoding: string
) - > string|any
Convert bytes objects to strings, using the given encoding. Illegally encoded input characters are replaced with Unicode "unknown" codepoint (\ufffd). Return any non-bytes objects without change.
Parameters
| Name | Type | Description |
|---|---|---|
| s | any | The input object to be converted if it is a bytes instance |
| encoding | string | The character encoding used to decode the bytes object, such as "utf-8" |
Returns
| Type | Description |
|---|---|
| `string | any` |