2 ms·
If you do want to ensure the file is interpreted as UTF-8 regardless of HTTP headers, the most efficient way is to place a U+FEFF "byte order mark" character (E
by csande17 2y ago
If you do want to ensure the file is interpreted as UTF-8 regardless of HTTP headers, the most efficient way is to place a U+FEFF "byte order mark" character (EF BB BF when encoded as UTF-8) at the start of the file. It's shorter than a meta tag, and it's the first thing browsers check for when loading a file (assuming they're following https://html.spec.whatwg.org/multipage/parsing.html#determining-the-character-encoding https://html.spec.whatwg.org/multipage/parsing.html#determin...).