Interesting, I hadn't considered binary data, but does the charset even make a difference if the content type is not text?
I'm not sure, likely not. I was hoping you'd check that in Gecko before signing off on the patch.
That aside, `IsTextUnicode` is a pretty questionable function. It relies on heuristics, and from what I’ve seen, `IS_TEXT_UNICODE_STATISTICS` can easily give false positives, especially with UTF-8 input. We may unfortunately need something like it to match IE behavior, but reducing our exposure to the problem would be an improvement, in my opinion.
One way to limit its use specifically to CSS would be to move the check into `SheetLoadData::OnDetermineCharset`.