pypi / charset-normalizer
charset-normalizer
What changed in charset-normalizer 2 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-23.
23 breaking1 deprecations3 new APIs and options7 performance5 behavior and defaults4 tooling20 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initcharset-normalizer 350 changes
Breaking changes 19
Large content with high-entropy noise detector output is no longer decoded, affecting inputs larger than 1M bytes.
Files containing both a charset declaration and BOM/SIG now verify the BOM/SIG charset first.
Removed in favor of feed_info, requiring callers to use the replacement API.
Replaces eligible and feed as the preferred API for the flattened logic.
The best() method was removed from CharsetMatch.
The chaos_secondary_pass property was removed from CharsetMatch.
The CharsetDetector class alias was removed.
The CharsetDoctor class alias was removed.
The CharsetNormalizerMatch class alias was removed.
The CharsetNormalizerMatches class alias was removed.
The coherence detector now returns Chinese instead of Classical Chinese.
The coherence_non_latin property was removed from CharsetMatch.
The first() method was removed from CharsetMatch.
Language detection is stricter.
The top-level normalize function was removed.
The coherence detector now returns English instead of Simple English.
Support for the unicodedata2 backport was removed.
UTF-7 is no longer detected without a recognized SIG or mark because it is unreliable and conflicts with ASCII.
The w_counter property was removed from CharsetMatch.
New APIs and options 2
Alternative language frequency sets are supported through FREQUENCIES.
from_bytes, from_path, and from_fp accept language_threshold to adjust the minimum expected coherence ratio.
Performance 5
CharsetMatches no longer sort on each match insertion, reducing repeated sorting work.
Cascade codec imports were changed to reduce wall import time.
Measurements no longer use a global cache, reducing RSS memory usage.
Noise and coherence measurements received micro-optimizations.
The module can optionally be compiled using Mypyc for an extra speedup of up to 4x compared with v2.1.
Behavior and default changes 4
The algorithm no longer uses regex search by default.
Updated using Unicode blocks v17, changing the Unicode range data used by charset detection.
When cp_isolation contains one or two entries, explain=True logs detailed Mess-detector results.
The version command now indicates whether the current version provides extra speedup from a mypyc compilation wheel.
Tooling 4
The Cython upper bound is now <3.4 for native builds; abi3 builds remain capped below 3.3 for Python 3.7 Limited API compatibility.
abi3 wheels are now distributed, reducing the need to rush releases for new Python interpreters.
Optional mypyc builds were replaced with Cython extensions while retaining the pure Python fallback.
Pre-built freethreaded wheels are now shipped in PyPI for freethreaded Python environments.
Fixes and other changes 16
Supported encodings without aliases now resolve correctly and are no longer ignored in charset declarations.
Valid UTF-8 Chinese JSON is no longer incorrectly detected as PTCP154 because of excessive noise penalties for uncommon CJK characters.
Comparisons with non-alias encoding strings were fixed.
Empty payloads now return 0.0 instead of crashing.
Detection of iso2022* cases was corrected by fixing multibyte chunking logic.
Explicit support for Python 3.15 was added.
Fixed a regression in the fallback path that could lead to a decode error.
Inverse capitalization is now recognized by the noise detector.
The redundant UTF7 BOM marker was removed.
Correctly removes the SIG remnant from utf-7 decoded strings.
Fixed an edge case where noise differences between candidates could be almost insignificant.
Fixed writing to the wrong path when normalizing multiple files.
Passing a bytearray to from_bytes no longer raises TypeError.
Logger levels are restored correctly when processing empty byte sequences.
Fixed a CLI failure when --normalize is used with full file paths.
Fixed false positives in mess detection when too few alphabetic characters have been fed to the plugin.
charset-normalizer 213 changes
Breaking changes 4
The package no longer requires cached_property when used with Python 3.5.
The CLI now outputs absolute paths instead of relative paths for files.
Support was removed for Catalan, Esperanto, Kazakh, Baque, Volapük, Azeri, Galician, Nynorsk, Macedonian, and Serbocroatian.
The exception hook on UnicodeDecodeError has been removed.
Deprecations 1
The CharsetMatch method is deprecated and scheduled for removal in v3.0.
New APIs and options 1
The CLI adds a --version argument.
Performance 2
Detection is 4x to 5x faster than the previous 1.4.0 release and at least 2x faster than Chardet.
Accent has been made on UTF-8 detection, which should perform rather instantaneously.
Behavior and default changes 1
When no language is detected in content, the package tries to infer it using the encoding name or alphabets used.
Fixes and other changes 4
The legacy function returns an identical charset name to Chardet whenever possible.
Python 3.5 support is retained in v2.
The detection mechanism now detects Turkish content correctly most of the time.
Detection for utf_7 has been reinstated.