Whole file

jawah/charset_normalizer

The author described this change as :bug: output(...) replace declarative mark using non iana compliant encoding name. It counts as a record because the check below fails on the code as it stood at 1b06bc040 and passes on 14b4649fa, with nothing else changed between the two runs.

Fix saved2024-12-24
Sharing licenceMIT · LICENSE
Change size+1 1

What the code was meant to do, written into the code itself as a save note

:bug: output(...) replace declarative mark using non iana compliant encoding name

The change

222222 RE_POSSIBLE_ENCODING_INDICATION,
223223 lambda m: m.string[m.span()[0] : m.span()[1]].replace(
224224 m.groups()[0],
225- iana_name(self._output_encoding), # type: ignore[arg-type]
225+ iana_name(self._output_encoding).replace("_", "-"), # type: ignore[arg-type]
226226 ),
227227 decoded_string[:8192],
228228 count=1,

The check that tells the two apart

failpass·tests/test_preemptive_detection.py::test_preemptive_mark_replacement[<?xml

Check file tests/test_preemptive_detection.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it1b06bc0407dc0f47e9629cbc802977711d0ffc7b
Broken version dated2024-12-24
Modulecharset_normalizer.models
Units changedCharsetMatch
Fingerprintd19a6a8ffe774109
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in jawah/charset_normalizer