Jason Knight
Sep 19, 2022

--

Two details you missed.

1) If the HTTP header is set, the browser ignores what you say in the HTML. If the server is sending:

Content-Type: text/html; charset=UTF-8

The modern charset <meta> and the old http-equiv version do bupkis. This can be a problem on old servers which will send charset=iso-8859-1 as their default headers.

2) If you have CDATA such as the content of your <title>, or content="" on tag like <meta> before the charset declaration, the browser -- if obeying said meta due to lack of the HTTP header -- will throw away its parsing and start over at the start of the document.

Which is why the charset META should be the very first tag after you open <head>. Thus that "1024 bytes" thing becomes mostly irrelevant as there's a far more important action at play.

--

--

Jason Knight
Jason Knight

Written by Jason Knight

Accessibility and Efficiency Consultant, Web Developer, Musician, and just general pain in the arse

No responses yet