---
source: https://iinventedlight.com/library/notes/python-email-header.md
title: "Python email.header: encode internationalized email header values"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF License Version 2 (Python Software Foundation); PSF License Version 2 (CPython); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, email.header: Internationalized headers; CPython, email.header documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: python-email-header"
tags: [python, email, header, RFC-2047, charset]
client: Librarian
sources:
  - id: S1
    title: "email.header: Internationalized headers"
    publisher: Python Software Foundation
    url: https://docs.python.org/3/library/email.header.html
    accessed: 2026-11-26
    license: "PSF License Version 2"
  - id: S2
    title: "email.header documentation (source)"
    publisher: CPython
    url: https://raw.githubusercontent.com/python/cpython/main/Doc/library/email.header.rst
    accessed: 2026-11-26
    license: "PSF License Version 2"
---
# Python email.header: encode internationalized email header values
**Answer:** The email.header module supplies a Header class for encoding header values that go beyond 7-bit ASCII.

## Why this module still exists

RFC 2822 describes the email message format and assumes 7-bit ASCII only.

Language specific character sets can now be used in email messages.

The email package covers those later RFCs in email.header and email.charset.

You import Header from email.header when you need that encoding control.

## Building and folding a Header

Optional s is the initial header value. If None, the initial header value is not set, and you can later append to the header with append method calls.

If you omit charset, us-ascii is used for the first value and as the default for later appends.

The default maximum line length is 78.

continuation_ws defaults to a single space and is prepended to continuation lines.

## See also

- [python-email](https://iinventedlight.com/library/notes/python-email/)
- [python-email-message](https://iinventedlight.com/library/notes/python-email-message/)
- [python-email-parser](https://iinventedlight.com/library/notes/python-email-parser/)

## Claims

- id: C1
  claim: RFC 2822 assumes email uses only 7-bit ASCII.
  source: S1
  evidence: "RFC 2822 is a specification written assuming email contains only 7-bit ASCII characters."

- id: C2
  claim: Import Header from email.header.
  source: S1
  evidence: "Import the Header class from the email.header module."

- id: C3
  claim: The default maximum line length is 78.
  source: S2
  evidence: "The default *maxlinelen* is 78"

- id: C4
  claim: The constructor takes a continuation_ws parameter.
  source: S2
  evidence: "continuation_ws=' '"

## Sources

- [S1] email.header: Internationalized headers. Python Software Foundation. https://docs.python.org/3/library/email.header.html . License: PSF License Version 2. Accessed 2026-11-26.

- [S2] email.header documentation (source). CPython. https://raw.githubusercontent.com/python/cpython/main/Doc/library/email.header.rst . License: PSF License Version 2. Accessed 2026-11-26.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, email.header: Internationalized headers; CPython, email.header documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
