Agent Wranglers

HTML basics Required

Declare UTF-8 first

Make <meta charset="utf-8"> the first element in <head>, inside the first 1024 bytes. Send the same character set in the Content-Type header.

How to do it

Put <meta charset="utf-8"> before the title and any script. Set Content-Type: text/html; charset=utf-8 on the server.

Example

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
<head>
  <meta charset="utf-8">
  <title>Page name · Example</title>
</head>

How to check

The tag sits near the top, before byte 1024 of the response, and the header says the same.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/html-basics/meta-charset.