Skip to content

UnicodeDecodeError in Python 3 #84

@cykerway

Description

@cykerway

return data.decode(), b''

This line caused a decoding error when run with Python 3.6:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd4 in position 0: invalid continuation byte

I'm wondering whether data.decode() will ever work for values in range [128, 256).

data.decode('latin1') solves my issue. But I think there may be similar cases in other parts of the project.

Pull Request: #85

The default encoding in Python 3 is utf-8, which doesn't work in this case. ascii won't work, either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions