RFC Errata
RFC 2397, "The "data" URL scheme", August 1998
Source of RFC: Legacy
Errata ID: 5923
Status: Reported
Type: Technical
Publication Format(s) : TEXT
Reported By: Richard Gibson
Date Reported: 2019-11-29
Section 3 says:
3. Syntax dataurl := "data:" [ mediatype ] [ ";base64" ] "," data mediatype := [ type "/" subtype ] *( ";" parameter ) data := *uric parameter := attribute "=" value where "uric" is imported from [RFC2396], and "type", "subtype", "attribute" and "value" are the corresponding tokens from [RFC2045], represented using URL escaped encoding of [RFC2396] as necessary. Attribute values in [RFC2045] are allowed to be either represented as tokens or as quoted strings. However, within a "data" URL, the "quoted-string" representation would be awkward, since the quote mark is itself not a valid urlchar. For this reason, parameter values should use the URL Escaped encoding instead of quoted string if the parameter values contain any "tspecial".
It should say:
3. Syntax dataurl := "data:" [ mediatype ] [ ";base64" ] "," data mediatype := [ type "/" subtype ] *( ";" parameter ) data := *uric parameter := attribute "=" value value := token where "uric" is imported from [RFC2396], and "type", "subtype", "attribute" and "token" are the corresponding syntax from [RFC2045], with values represented using %xx escaped encoding of [RFC2396] as necessary. Parameter values in [RFC2045] are allowed to be either represented as tokens or as quoted strings. However, within a "data" URL, the "quoted-string" representation would be awkward, since the quote mark is itself not a valid urlchar. For this reason, parameter values are required to be represented as tokens and %xx encoding MUST be used for "tspecials" characters within them.
Notes:
Section 3 is not clear about excluding the "quoted-string" production completely as opposed to permitting it through percent-encoding, resulting in ambiguity for interpretation of URLs such as "data:text/example;foo=%22bar%22,*baz*". But Section 5 refers to accepted changes that 'eliminate "quoted printable" as an encoding since it would not easily yield valid URLs without additional %xx encoding, which itself is sufficient', so it seems that the intent is to *replace* quoted-string and always interpret percent-encoded characters as content (i.e., that my example corresponds with `Content-Type: text/example; foo="\"bar\""` rather than `Content-Type: text/example;foo="bar").