RFC 1874

SGML Media Types

πŸ“… published December 1995, from ietf

RFC 1874: SGML Media Types πŸ’–

Okay bestie, so this one is from the Network Working Group and it's written by E. Levinson of Accurate Information Systems, Inc. ✨ It's in the Experimental category and dated December 1995. The header doesn't list anything it obsoletes or updates, so it's just a fresh little proposal 🌸


Status of this Memo πŸ¦‹

This memo defines an Experimental Protocol for the Internet community, and it is NOT an Internet standard of any kind πŸ™ˆ The author wants your discussion and suggestions for improvement, and distribution of this memo is unlimited πŸ’œ


Abstract ✨

This doc proposes new media sub-types, Text/SGML and Application/SGML πŸŽ€ They're for sending SGML documents and their entities around. How you'd exchange or wrap up groups of related SGML entities using MIME is still being figured out by the mimesgml Working Group <sgml-internet@ebt.com> 🧚


1. Introduction 🌈

Okay so, there's a real need to transfer the pieces of documents built with the Standard Generalized Markup Language (SGML) [ISO-8879] πŸ“„ Even though the nitty-gritty details of those transfers are still being discussed, everyone agrees we should register basic media types for the SGML entities that existing types don't cover yet 🫢

SGML is what encodes document structure, and the rigorous definition lives in [ISO-8879] πŸ’… The terms in this document try to match SGML terminology and usage, so you're not getting a made-up vocabulary, periodt ✨


2. The SGML Media-Types πŸ’–

There are two media-types for SGML parsable entities: Text/SGML and Application/SGML πŸŽ€ They have the same optional parameters. Text/SGML gives a fallback to Text/Plain for anything without SGML capability 🌸

Senders should base the choice between text and application media-types on the entity's content 🧐 Text is suggested for entities that a human could make sense of without SGML processing. Application/SGML is recommended for literally everything else πŸ’…

2.1. Text/SGML πŸ¦‹

MIME type name:          Text
MIME subtype name:       SGML
Required parameters:     none
Optional parameters:     charset, SGML-bctf, SGML-boot
Encoding considerations: may be encoded
Security considerations: see section 4 below
Published specification: ISO 8879:1986
Person and email address to contact for further information:
                                  E. Levinson <ELevinson@Accurate.com>

The Text/SGML media-type is for when the SGML entity is meant to be read by a human and is in a readily comprehensible form πŸ‘€ Basically, someone without SGML display software can easily figure out what it says ✨ Each record in the SGML entity, which is delimited by record start (RS) and record end (RE) codes, must correspond to a line in the Text/SGML body part πŸ“

If an SGML entity doesn't meet the requirements above, it should use the Application/SGML media-type πŸ™ˆ

See section 2.3 for a description of the parameters πŸ’œ

2.2. Application/SGML 🌈

MIME type name:          Application
MIME subtype name:       SGML
Required parameters:     none
Optional parameters:     SGML-bctf, SGML-boot
Encoding considerations: may be encoded
Security considerations: see section 4 below
Published specification: ISO-8879
Person and email address to contact for further information:
                                  E. Levinson <ELevinson@Accurate.com>

Use Application/SGML for SGML text entities that aren't a good fit for Text/SGML πŸ’… When you use it, each record start (RS) and record end (RE) character shall be explicitly represented by the bit combination specified in the SGML declaration πŸ”₯

The parameters are up next πŸŽ€

2.3. SGML Sub-type Parameters πŸ’–

The parameters for the Text/ and Application/SGML subtypes are defined below 🧚

charset: The charset parameter for Text/SGML is defined in [RFC-1521]. The valid values and what they mean are registered by the Internet Assigned Numbers Authority (IANA) [RFC-1590] 🌸 The default charset value for all Text content-types is "us-ascii" [RFC-1521] ✨

This parameter exists so that non-SGML capable systems can still behave reasonably when Text/SGML falls back to Text/Plain 🫢 SGML capable systems will use the SGML-bctf parameter instead πŸ¦‹

SGML-bctf: This parameter (SGML bit combination transformation format) describes the method used to turn the entity's sequence of constant width binary numbers (called "bit combinations" in [ISO 8879, 4.24]) into the octet stream in the MIME body part πŸ€“

The valid values for SGML-bctf are the BCTF notation names defined in Annex C of [ISO-10744], and they're reproduced for convenience in the Appendix πŸ“š The default value is "identity", meaning perform no transformation at all πŸ’…

SGML-boot: The SGML-boot parameter value is the content-ID of a MIME body part (Application/Octet-stream) that satisfies the requirements of the boot attribute in [ISO-10744] 🌈 The Appendix has a summary of those requirements. This parameter is only applicable if the SGML entity is a document entity πŸ‘‘


3. Security Considerations πŸ’€

Real talk, this section matters 🚨 SGML entities contain information that the recipient's SGML system parses and processes. Those entities may contain and such systems may permit explicit system level commands to be execute while processing the data. To the extent that an SGML system will execute arbitrary command strings, recipients of SGML entities may be at risk 😭

Parsable SGML entities may also contain explicit processing instructions for a presentation or composition system. Using such instructions raises concerns similar to those of Application/PostScript πŸ™ˆ

4. References πŸ“š

  • [ISO-8879] Information processing -- 8-bit Single-Byte Coded Graphic Character Sets -- Part 1: Latin Alphabet No. 1, ISO 8859-1:1987.
  • [ISO-8879] ISO 8879:1986, Information processing -- Text and office systems -- Standard Generalized Markup Language (SGML).
  • [ISO-10744] ISO/IEC 10744:1992, Information technology -- Hypermedia/Time-based Structuring Language (HyTime) (as modified by First Proposed Technical Corrigendum, ISO/IEC JTC1/SC18 N5027)
  • [RFC-1521] Borenstein, N., and N. Freed, "MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies", RFC 1521, Bellcore, Innosoft, September 1993.
  • [RFC-1590] Postel, J., "Media Type Registration Procedure", RFC 1590, USC/Information Sciences Institute, March 1994.
  • [RFC-1642] Goldsmith, D., and M. Davis, "UTF-7, A Mail-Safe Transformation Format of UNICODE", RFC 1642, Taligent, Inc., July 1994.

5. Author's Address πŸŽ€

Ed Levinson
Accurate Information Systems, Inc.
2 Industrial Way
Eatontown, NJ  07724

EMail: ELevinson@Accurate.com

APPENDIX: ISO-10744 BCTF Values and Boot Attribute 🧚

A.1. Bit Combination Transformation Format (BCTF) Values πŸ’–

This list of BCTF values is here as a convenience 🌸 The authoritative source is [ISO-10744] πŸ“–

  • identity: Each bit combination is represented by a single octet. This BCTF can only be used for entities where every bit combination has a value not exceeding 255 πŸ”’
  • fixed-2: Each bit combination is represented by exactly 2 octets, with the more significant octet first. This BCTF can only be used for entities where every bit combination has a value not exceeding 65535 ✨
  • fixed-3: Each bit combination is represented by exactly 3 octets, with a more significant octet preceding any less significant octets. This BCTF can only be used for entities where every bit combination has a value not exceeding 16777215 πŸ’œ
  • fixed-4: Each bit combination is represented by exactly 4 octets, with a more significant octet preceding any less significant octets πŸ¦‹
  • utf-8: Each bit combination is represented by a variable number of octets according to UCS Transformation Format 8, defined in Annex P (to be added by the first proposed drafted amendment, PDAM 1, to ISO/IEC 10646-1:1993) 🌈
  • utf-7: Each bit combination is represented by a variable number of octets in the range 0 through 127, as described in [RFC-1642]. This BCTF can only be used for entities where every bit combination has a value not exceeding 65535 🫢
  • euc-jp: Each bit combination is treated as a pair of octets, most significant octet first, encoding a character using the Extended_UNIX_Code_Fixed_Width_for_Japanese charset. It's then transformed into the variable length sequence of octets that would encode that character using the Extended_UNIX_Code_Packed_Format_for_Japanese charset πŸ‡―πŸ‡΅
  • sjis: Each bit combination is treated as a pair of octets, most significant octet first, encoding a character using the Extended_UNIX_Code_Fixed_Width_for_Japanese charset. It's then transformed into the variable length sequence of octets that would encode that character using the Shift_JIS charset πŸ“

A.2. The Boot Attribute πŸ‘‘

The body part specified by the SGML-boot parameter contains a sequence of triplets of positive integers separated by white space πŸ”₯ The triplets correspond to the described character set portion [IS0-8879, 13.1.1.2] of the SGML declaration πŸ“œ

SGML-boot lets you identify the character set of the document's SGML declaration when it uses significant SGML characters [ibid., 4.298] in the SGML reference concrete syntax [ibid., 13.4] that have a character number [ibid., 4.44] in the document's character set that differs from us-ascii πŸ€“ The default value is "0 128 0", meaning all characters are us-ascii πŸ’…

Notes:

  1. The triplet <dscn noc bscn> means this: starting with character number dscn in the us-ascii character set, renumber noc characters starting at bscn and incrementing by one. So 0 128 0 represents the identity mapping πŸ¦‹
  2. The document's declaration itself may also redefine the significant SGML characters. The boot attribute is intended to bootstrap the SGML system's parse of the declaration 🌸

Bestie, that's the whole spec, and you absolutely slayed it πŸ’–πŸŒˆβœ¨

πŸ“¦ where this page comes from