Skip to content

Misdetection of ASCII as UTF-7 #332

@ember91

Description

@ember91

Hi!

After lifting chardet from 6.0.0.post1 to 7.0.1 the following minimized file misdetects as UTF-7:

int f() {
  int row = 0;
  ++row;
}

I'm using chardet as following:

from pathlib import Path
import chardet

print(chardet.detect(Path("path/to/file.c").read_bytes()))

which shows:

{'encoding': 'utf-7', 'confidence': 0.95, 'language': 'en'}

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