unstale

pypi / chardet

chardet

What changed in chardet 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-28.

8 breaking1 security1 deprecations1 new APIs and options2 performance4 behavior and defaults20 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.9 on npm

chardet 737 changes

Breaking changes 8

  • is_multibyte_cjk is the new name for the EncodingInfo field previously named is_multibyte.

    7.7.0release notes

  • Markup declarations follow the WHATWG prescan: comments and unrelated attributes no longer supply the charset, while quoted or spaced content charsets work.

    7.7.0release notes

  • Compiled builds now require both the mypyc and custom build hooks to be enabled.

    7.6.0release notes

  • Low-confidence rare-language winners yield to near-tied mainstream candidates; rare-language labels on inputs under 128 bytes need a 0.03 lead.

    7.6.0release notes

  • Statistical ties no longer resolve according to candidate enumeration order.

    7.6.0release notes

  • UTF-7 detection now requires the whole buffer to decode as UTF-7, and a lone shifted character must fall in a plausible script range.

    7.6.0release notes

  • The BOM stage recognizes the four UTF-7 signature prefixes when the rest of the buffer decodes as UTF-7.

    7.6.0release notes

  • Valid multi-byte UTF-8 now wins over a conflicting charset declaration.

    7.5.1release notes

Security 1

  • The cache is capped at 1024 entries because charset names can come from untrusted markup.

    7.7.0release notes

Deprecations 1

  • is_multibyte is deprecated with a DeprecationWarning and will be removed in 8.0; use is_multibyte_cjk instead.

    7.7.0release notes

New APIs and options 1

  • The new -m/--mime-type flag shows the MIME type next to the encoding.

    7.7.0release notes

Performance 2

  • Large max_bytes values no longer make detection slow; evidence gathering stops at a 256 KiB cap, while UTF-8 validation and the final decode still read the whole window. Default calls are unchanged.

    7.7.0release notes

  • Compiled wheels use a small Cython kernel alongside mypyc for bigram scoring; the pair is 4.7x faster than the pure wheel on CPython 3.14, with bit-identical output.

    7.6.0release notes

Behavior and default changes 4

  • Visual-order Hebrew is now detected.

    7.7.0release notes

  • Every bigram model was retrained on a refreshed, deduplicated corpus, changing the models used for detection.

    7.6.0release notes

  • Confusion-group resolution now uses per-occurrence votes, word-shape demotions, and an art-model exemption; tied pairs are compared only under language models both encodings have.

    7.6.0release notes

  • A new ANSI-art model supports detection of text-mode art encoded as cp437.

    7.6.0release notes

Fixes and other changes 20

  • The deprecated chardet.equivalences shim has been fixed.

    7.7.0release notes

  • Input cut exactly at the byte cap is no longer mistaken for the whole stream.

    7.7.0release notes

  • cp864 Arabic is trained on contextually shaped text in visual order, matching how real cp864 systems stored it.

    7.7.0release notes

  • Every answer now decodes the examined window under the returned encoding name, preventing confident detections that would fail when the rest of the window is decoded.

    7.7.0release notes

  • The ranking of detect_all() results has been fixed.

    7.7.0release notes

  • EBCDIC XML MIME types have been fixed.

    7.7.0release notes

  • Null-separated records like find -print0 output no longer come back as UTF-16-LE with Chinese as the language.

    7.7.0release notes

  • Cookie resolution now matches tokenize.detect_encoding, including when a line-2 cookie counts.

    7.7.0release notes

  • With prefer_superset=True, chardet no longer substitutes a code page that cannot decode the data and now respects include_encodings and exclude_encodings.

    7.7.0release notes

  • Language labels on Unicode text are less likely to favor accent-heavy languages; a French paragraph with a few accents no longer comes back as Hungarian.

    7.7.0release notes

  • Input cut exactly at the byte cap is no longer mistaken for the whole stream.

    7.7.0release notes

  • BOM-bearing UTF-32 is no longer detected as UTF-16 when max_bytes cuts a code unit.

    7.7.0release notes

  • Mostly-ASCII Windows-1252 and English text with a lone accented character no longer receive the cited incorrect encoding labels.

    7.7.0release notes

  • CPython 3.15, including its free-threaded build, is now supported.

    7.6.0release notes

  • When the winning candidate's only multi-byte evidence is an incomplete trailing sequence, a candidate that decodes the complete input wins; genuinely truncated data keeps its answer.

    7.6.0release notes

  • EBCDIC text is now visible to early pipeline stages, and the last two EBCDIC sibling misdetections are fixed.

    7.6.0release notes

  • Training normalization gaps that starved ISO-8859-16 and 26 pre-euro encodings at their distinguishing bytes are fixed.

    7.6.0release notes

  • Statistical scoring skips repeated-whitespace bigrams, fixing space-padded text and windows-1251 logs being misdetected.

    7.6.0release notes

  • Byte order for BOM-less UTF-16 is now chosen by decoding both ways and comparing text quality.

    7.5.1release notes

  • CP932 and CP949 promotion now fires when the reported name cannot decode the data but the superset can.

    7.5.1release notes