Accept-Charset
The Accept-Charset header describes which character sets are acceptable in textual response content.
As most servers have standardized on using UTF-8, use of this header has disappeared. Since RFC 9110, use of this header is discouraged.
Overview table
- Name
- Accept-Charset
- Description
- Indicates which character sets are acceptable in responses.
- Direction
- Request
- Negotiates
- Content-Type (the character set of the media type)
- List usage in
- Vary
- Specification
- RFC 9110: HTTP Semantics §12.5.2. Accept-Charset
Syntax
Accept = #( media-range [ accept-params ] ) media-range = ( "*/*" / ( type "/" "*" ) / ( type "/" subtype ) ) *( OWS ";" OWS parameter ) accept-params = weight *( accept-ext ) accept-ext = OWS ";" OWS token [ "=" ( token / quoted-string ) ]
Examples
Prefer HTML or text/x-c, or text/x-dvi if it’s the best the server has after a 20% markdown in quality, or plain text after a 50% markdown in quality:
Accept: text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c
Prefer XHTML or HTML, or generic XML with a reduced preference, or else any content:
Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8
History
- 1999-06: RFC 2616 §14.1. Accept-Charset.
- 2014-06: RFC 7231 §5.3.3. Accept-Charset
- 2022-06: RFC 9110 §12.5.2. Accept-Charset. The use of this header is now formally discouraged when not strictly necessary.