Skip to content

Add warning about encodings not supported by Python #71

@dan-blanchard

Description

@dan-blanchard

We currently detect EUC-TW pretty well, but it's not actually supported by Python. Most users would expect that

result = chardet.detect(some_bytes)
try:
    some_bytes.decode(result['encoding'])
except UnicodeDecodeError:
    print('Oops. chardet detected the wrong encoding')

would always work, but the decode line can actually fail with a LookupError too because of encodings that aren't supported by Python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions