Visual RFC.
ALL RFCs / RFC 7578
Read the RFC ↗
RFC 7578 / MULTIPART FORM DATA

Decode text using its character encoding

04

Text is sent as bytes. A charset names the character encoding needed to turn those bytes back into text; the body format does not make every unnamed text part UTF-8.

RFC 7578 · § 4.5EXAMPLE
4 / 4
04
Respect an explicit part encoding.

This different part explicitly selects ISO-8859-1. Its bytes are 63 61 66 E9; the default UTF-8 setting does not replace the explicit charset.

Decode text using its character encodingThis different part explicitly selects ISO-8859-1. Its bytes are 63 61 66 E9; the default UTF-8 setting does not replace the explicit charset.An explicit charset applies to its partcafétext/plain; charset=ISO-8859-1Hexadecimal byte values636166E94 bytes → caféExplicit charset takes precedence over the default

Key idea: An explicit part charset and an application’s default charset have different scopes.

Terms

Look up a term in the glossary ↗

Rules & examples
  • For text/plain form data, a charset parameter MAY identify that part’s character encoding. Content-Type itself remains optional and defaults to text/plain when absent.
  • In this fixture, café encoded as UTF-8 has hexadecimal bytes 63 61 66 C3 A9: four characters and five bytes. With Content-Type: text/plain; charset=UTF-8, the receiver can interpret those particular bytes accordingly.
  • Some applications use a hidden _charset_ entry to establish a default for text/plain parts that omit their own charset. This is a convention described in section 4.6, not a required field in every multipart body.
  • An explicit per-part charset supplies that part’s encoding instead of the default. The ISO-8859-1 encoding of café has hexadecimal bytes 63 61 66 E9, four bytes; decoding it as UTF-8 is not equivalent.
  • Form creators SHOULD avoid non-ASCII field names for interoperability and SHOULD use UTF-8 uniformly if such names are unavoidable (section 5.1.1). Other application context may be needed when no charset parameter or _charset_ value is supplied. Historical HTML selection rules are described in section 5.1.2; this guide does not claim to implement the current HTML form algorithm.

The teaching helper supports only UTF-8 and ISO-8859-1 and rejects unsupported encodings as outside its scope. It does not classify every other registered charset as invalid multipart data. Verified erratum 4676 is respected: the _charset_ part uses an intermediate delimiter, not a premature closing delimiter.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

What changed
Published RFC 7578 § 4.6 exampleVerified erratum 4676

The delimiter between the charset entry and the following part is not a closing delimiter. Only the final delimiter has trailing hyphens. The official inline-errata view incorporates this correction.

Read the updated RFC section ↗

All chapters in RFC 7578

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗