6657
PROPOSED STANDARD
Update to MIME regarding "charset" Parameter Handling in Textual Media Types
Authors: A. Melnikov, J. Reschke
Date: July 2012
Area: app
Working Group: appsawg
Stream: IETF
Updates:
RFC 2046
Abstract
This document changes RFC 2046 rules regarding default "charset" parameter values for "text/*" media types to better align with common usage by existing clients and servers. [STANDARDS-TRACK]
RFC 6657
PROPOSED STANDARD
Internet Engineering Task Force (IETF) A. Melnikov
Request for Comments: 6657 Isode Limited
Updates: <a href="./rfc2046">2046</a> J. Reschke
Category: Standards Track greenbytes
ISSN: 2070-1721 July 2012
<span class="h1">Update to MIME regarding "charset" Parameter Handling</span>
<span class="h1">in Textual Media Types</span>
Abstract
This document changes <a href="./rfc2046">RFC 2046</a> rules regarding default "charset"
parameter values for "text/*" media types to better align with common
usage by existing clients and servers.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="https://www.rfc-editor.org/info/rfc6657">http://www.rfc-editor.org/info/rfc6657</a>.
Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
<span class="grey">Melnikov & Reschke Standards Track [Page 1]</span>
<span id="page-2" ></span>
<span class="grey"><a href="./rfc6657">RFC 6657</a> MIME Charset Default Update July 2012</span>
Table of Contents
<a href="#section-1">1</a>. Introduction and Overview .......................................<a href="#page-2">2</a>
<a href="#section-2">2</a>. Conventions Used in This Document ...............................<a href="#page-2">2</a>
3. New Rules for Default "charset" Parameter Values for
"text/*" Media Types ............................................<a href="#page-3">3</a>
<a href="#section-4">4</a>. Default "charset" Parameter Value for "text/plain" Media Type ...<a href="#page-4">4</a>
<a href="#section-5">5</a>. Security Considerations .........................................<a href="#page-4">4</a>
<a href="#section-6">6</a>. IANA Considerations .............................................<a href="#page-4">4</a>
<a href="#section-7">7</a>. References ......................................................<a href="#page-4">4</a>
<a href="#section-7.1">7.1</a>. Normative References .......................................<a href="#page-4">4</a>
<a href="#section-7.2">7.2</a>. Informative References .....................................<a href="#page-5">5</a>
<a href="#appendix-A">Appendix A</a>. Acknowledgements ......................................<a href="#page-6">6</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction and Overview</span>
<a href="./rfc2046">RFC 2046</a> specified that the default "charset" parameter (i.e., the
value used when the parameter is not specified) is "US-ASCII"
(<a href="./rfc2046#section-4.1.2">Section 4.1.2 of [RFC2046]</a>). <a href="./rfc2616">RFC 2616</a> changed the default for use
by HTTP (Hypertext Transfer Protocol) to be "ISO-8859-1" (<a href="./rfc2616#section-3.7.1">Section</a>
<a href="./rfc2616#section-3.7.1">3.7.1 of [RFC2616]</a>). This encoding is not very common for new
"text/*" media types and a special rule in the HTTP specification
adds confusion about which specification ([<a href="./rfc2046" title=""Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types"">RFC2046</a>] or [<a href="./rfc2616" title=""Hypertext Transfer Protocol -- HTTP/1.1"">RFC2616</a>]) is
authoritative in regards to the default charset for "text/*" media
types.
Many complex text subtypes such as "text/html" [<a href="./rfc2854" title=""The 'text/html' Media Type"">RFC2854</a>] and "text/
xml" [<a href="./rfc3023" title=""XML Media Types"">RFC3023</a>] have internal (to their format) means of describing
the charset. Many existing User Agents ignore the default of "US-
ASCII" rule for at least "text/html" and "text/xml".
This document changes <a href="./rfc2046">RFC 2046</a> rules regarding default "charset"
parameter values for "text/*" media types to better align with common
usage by existing clients and servers. It does not change the
defaults for any currently registered media type.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Conventions Used in This Document</span>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
<span class="grey">Melnikov & Reschke Standards Track [Page 2]</span>
<span id="page-3" ></span>
<span class="grey"><a href="./rfc6657">RFC 6657</a> MIME Charset Default Update July 2012</span>
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. New Rules for Default "charset" Parameter Values for "text/*" Media</span>
<span class="h2"> Types</span>
<a href="./rfc2046#section-4.1.2">Section 4.1.2 of [RFC2046]</a> says:
The default character set, which must be assumed in the absence of
a charset parameter, is US-ASCII.
As explained in the Introduction section, this rule is considered
outdated, so this document replaces it with the following set of
rules:
Each subtype of the "text" media type that uses the "charset"
parameter can define its own default value for the "charset"
parameter, including the absence of any default.
In order to improve interoperability with deployed agents, "text/*"
media type registrations SHOULD either
a. specify that the "charset" parameter is not used for the defined
subtype, because the charset information is transported inside
the payload (such as in "text/xml"), or
b. require explicit unconditional inclusion of the "charset"
parameter, eliminating the need for a default value.
In accordance with option (a) above, registrations for "text/*" media
types that can transport charset information inside the corresponding
payloads (such as "text/html" and "text/xml") SHOULD NOT specify the
use of a "charset" parameter, nor any default value, in order to
avoid conflicting interpretations should the "charset" parameter
value and the value specified in the payload disagree.
Thus, new subtypes of the "text" media type SHOULD NOT define a
default "charset" value. If there is a strong reason to do so
despite this advice, they SHOULD use the "UTF-8" [<a href="./rfc3629" title=""UTF-8, a transformation format of ISO 10646"">RFC3629</a>] charset as
the default.
Regardless of what approach is chosen, all new "text/*" registrations
MUST clearly specify how the charset is determined; relying on the
default defined in <a href="./rfc2046#section-4.1.2">Section 4.1.2 of [RFC2046]</a> is no longer permitted.
However, existing "text/*" registrations that fail to specify how the
charset is determined still default to US-ASCII.
Specifications covering the "charset" parameter, and what default
value, if any, is used, are subtype-specific, NOT protocol-specific.
Protocols that use MIME, therefore, MUST NOT override default charset
<span class="grey">Melnikov & Reschke Standards Track [Page 3]</span>
<span id="page-4" ></span>
<span class="grey"><a href="./rfc6657">RFC 6657</a> MIME Charset Default Update July 2012</span>
values for "text/*" media types to be different for their specific
protocol. The protocol definitions MUST leave that to the subtype
definitions.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Default "charset" Parameter Value for "text/plain" Media Type</span>
The default "charset" parameter value for "text/plain" is unchanged
from [<a href="./rfc2046" title=""Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types"">RFC2046</a>] and remains as "US-ASCII".
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Security Considerations</span>
Guessing of the "charset" parameter can lead to security issues such
as content buffer overflows, denial of services, or bypass of
filtering mechanisms. However, this document does not promote
guessing, but encourages use of charset information that is specified
by the sender.
Conflicting information in-band vs. out-of-band can also lead to
similar security problems, and this document recommends the use of
charset information that is more likely to be correct (for example,
in-band over out-of-band).
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. IANA Considerations</span>
IANA has updated the "text" subregistry of the Media Types registry
(<<a href="http://www.iana.org/assignments/media-types/text/">http://www.iana.org/assignments/media-types/text/</a>>) to add the
following preamble: "See [<a href="./rfc6657">RFC6657</a>] for information about 'charset'
parameter handling for text media types."
Also, IANA has added this RFC to the list of references at the
beginning of the Application for Media Type
(<<a href="http://www.iana.org/form/media-types">http://www.iana.org/form/media-types</a>>).
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. References</span>
<span class="h3"><a class="selflink" id="section-7.1" href="#section-7.1">7.1</a>. Normative References</span>
[<a id="ref-RFC2046">RFC2046</a>] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part Two: Media Types", <a href="./rfc2046">RFC 2046</a>,
November 1996.
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RFC3629">RFC3629</a>] Yergeau, F., "UTF-8, a transformation format of ISO
10646", STD 63, <a href="./rfc3629">RFC 3629</a>, November 2003.
<span class="grey">Melnikov & Reschke Standards Track [Page 4]</span>
<span id="page-5" ></span>
<span class="grey"><a href="./rfc6657">RFC 6657</a> MIME Charset Default Update July 2012</span>
<span class="h3"><a class="selflink" id="section-7.2" href="#section-7.2">7.2</a>. Informative References</span>
[<a id="ref-RFC2616">RFC2616</a>] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", <a href="./rfc2616">RFC 2616</a>, June 1999.
[<a id="ref-RFC2854">RFC2854</a>] Connolly, D. and L. Masinter, "The 'text/html' Media
Type", <a href="./rfc2854">RFC 2854</a>, June 2000.
[<a id="ref-RFC3023">RFC3023</a>] Murata, M., St. Laurent, S., and D. Kohn, "XML Media
Types", <a href="./rfc3023">RFC 3023</a>, January 2001.
<span class="grey">Melnikov & Reschke Standards Track [Page 5]</span>
<span id="page-6" ></span>
<span class="grey"><a href="./rfc6657">RFC 6657</a> MIME Charset Default Update July 2012</span>
<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>. Acknowledgements</span>
Many thanks to Ned Freed and John Klensin for comments and ideas that
motivated creation of this document, and to Carsten Bormann, Murray
S. Kucherawy, Barry Leiba, and Henri Sivonen for feedback and text
suggestions.
Authors' Addresses
Alexey Melnikov
Isode Limited
5 Castle Business Village
36 Station Road
Hampton, Middlesex TW12 2BX
UK
EMail: [email protected]
Julian F. Reschke
greenbytes GmbH
Hafenweg 16
Muenster, NW 48155
Germany
EMail: [email protected]
URI: <a href="http://greenbytes.de/tech/webdav/">http://greenbytes.de/tech/webdav/</a>
Melnikov & Reschke Standards Track [Page 6]
Annotations
Select text to annotate