Skip to content

1 sentence utf-8 detected as Windows-1252 #185

@EralpB

Description

@EralpB

Thanks for coming up with this utility, it's a great need but this fails even with simplest examples I can't see how I'd trust this on production.

bs_2 = b'Carter\xe2\x80\x99s Janitorial'
chardet.detect(bs_2)
{'encoding': 'Windows-1252', 'confidence': 0.73, 'language': ''}
bs_2.decode('cp1252')
'Carter’s Janitorial'
bs_2.decode('utf-8')
'Carter’s Janitorial'

am I doing something wrong? it's just couple of characters and it's clearly utf-8.

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