---
title: "Encode everything as UTF-8 · Agent Wranglers"
url: https://agentwranglers.se/playbook/email/message-basics/utf-8
updated: 2026-10-20
licence: "All rights reserved"
---

# Encode everything as UTF-8

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Message basics](https://agentwranglers.se/playbook/email/message-basics)
- Rule: Declare `charset=UTF-8` on every text part, and encode non-ASCII characters in headers as RFC 2047 encoded words.
- How: Store and send all text as UTF-8. In bodies, set the charset and use `quoted-printable` or `base64` transfer encoding (RFC 2045). In headers such as `Subject` and the display name, let the mail library write encoded words. Raw UTF-8 in headers is only allowed when the whole path supports SMTPUTF8 (RFC 6532).
- Check: Send a subject and a name with "Åsa", "Müller" and an emoji. They display correctly in at least two different mail clients, and "show original" shows `=?UTF-8?` encoded words.

Example:

```text
Subject: =?UTF-8?Q?Tack_f=C3=B6r_din_order?=
From: =?UTF-8?Q?=C3=85sa_M=C3=BCller?= <asa@example.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
```

**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 email playbook: https://agentwranglers.se/playbook/email/message-basics/utf-8`.

- Previous: [Include a plain-text part](https://agentwranglers.se/playbook/email/message-basics/plain-text-part)
- Next: [Declare the language and text direction](https://agentwranglers.se/playbook/email/message-basics/language-and-direction)
- [Message basics](https://agentwranglers.se/playbook/email/message-basics)
