
Media Types for Text
When data is stored in a file or transferred between systems and applications, it is
essential to keep track of the format of data. This is especially important on the Internet,
where the recipient of data may be prepared to handle different formats of data but
needs to know the format. For example, if some data is included in an email message
as an attachment, the message should internally carry information about the format of
the data, such as plain text (which can be rendered directly very simply) or rich text
(which needs to be processed in a rather complicated way in order to display it prop-
erly).
Internet media types (MIME types), described in Chapter 10, are used to specify the
general nature of a data set (file), such as image versus text, as well as its more specific
format. Here we will consider the major type text and its subtypes.
The Type text
The MIME specification (RFC 2046) defines the type text as follows:
The “text” media type is intended for sending material which is principally textual in
form. A “charset” parameter may be used to indicate the character set of the body text
for “text” subtypes, notably including the subtype “text/plain,” which is a generic sub-
type for plain text. Plain text does not provide for or allow formatting commands, font
attribute specifications, processing instructions, interpretation directives, or content
markup. Plain ...