It should be possible to implement it by assuming that only ASCII characters are compatible between encodings, and throwing out the document otherwise. Special care should be taken for encodings which are not entirely ASCII compatible (such as ISO 2022-JP and I believe Shift-JIS or possibly Big5).
We do not current support [changing the encoding](https://html.spec.whatwg.org/multipage/parsing.html#changing-the-encoding-while-parsing) while parsing.
It should be possible to implement it by assuming that only ASCII characters are compatible between encodings, and throwing out the document otherwise. Special care should be taken for encodings which are not entirely ASCII compatible (such as ISO 2022-JP and I believe Shift-JIS or possibly Big5).
We do not current support changing the encoding while parsing.
It should be possible to implement it by assuming that only ASCII characters are compatible between encodings, and throwing out the document otherwise. Special care should be taken for encodings which are not entirely ASCII compatible (such as ISO 2022-JP and I believe Shift-JIS or possibly Big5).