3 ms·
Some algorithms can operate much easier if they can assume that multibyte or variable byte characters don't exist. The BOM means that you don't have to scan the
by da_chicken 2y ago
Some algorithms can operate much easier if they can assume that multibyte or variable byte characters don't exist. The BOM means that you don't have to scan the entire document to know if you can do that.
- account42 2y agoNo, a missing BOM does not guarantee that the file doesn't contain multi-byte code points and never has.
- da_chicken 2y agoThat isn't what I said. I said that if a BOM is present, then you explicitly know that multi-byte characters are possibly present. Therefore, if it's present you know that assuming that the Nth byte is the Nth code point is unsafe. The opposite is irrelevant. There's never any way to safely determine a text file's encoding if there is no BOM present.