Small spec change required by RFC for lang params
colecmac at protonmail.com
colecmac at protonmail.com
Mon Dec 7 04:06:18 GMT 2020
Hello Geminauts,
A small spec change is required by RFC for the "lang" parameter in the
text/gemini mediatype.
Section 5.2 of the spec states:
> Valid values for the "lang" parameter are comma-separated lists of one
> or more language tags as defined in RFC4646. For example:
>
> - "text/gemini; lang=en" Denotes a text/gemini document written in English
> - "text/gemini; lang=fr" Denotes a text/gemini document written in French
> - "text/gemini; lang=en,fr" Denotes a text/gemini document written in a mixture of English and French
> - "text/gemini; lang=de-CH" Denotes a text/gemini document written in Swiss German
> - "text/gemini; lang=sr-Cyrl" Denotes a text/gemini document written in Serbian using the Cyrllic script
> - "text/gemini; lang=zh-Hans-CN" Denotes a text/gemini document written in Chinese using the Simplified script as used in mainland China
However, as can been seen in Go, the multi-language examples here are
not compliant with the relevant RFCs.
https://play.golang.org/p/7j0z3iORRmP
Attempting to parse the third example in the spec gives an error. After
digging through the Go source code, I eventually found a reference to
RFC 2045. On both page 12 and page 31, we see this relevant ABNF:
tspecials := "(" / ")" / "<" / ">" / "@" /
"," / ";" / ":" / "\" / <">
"/" / "[" / "]" / "?" / "="
; Must be in quoted-string,
; to use within parameter values
This clearly denotes that commas cannot be in a lang parameter without
quoting. Indeed, this is what we find when using the Go stdlib parser
again:
https://play.golang.org/p/L4qh1Qev-TS
My simple suggestion is to change these examples so the ones with commas
use quotes. Perhaps explicitly mention how quotes must be used for those
types of lang parameters.
Thanks,
makeworld
More information about the Gemini
mailing list