💾 Archived View for gemi.dev › gemini-mailing-list › 000528.gmi captured on 2024-05-26 at 16:07:28. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-12-28)

-=-=-=-=-=-=-

Small spec change required by RFC for lang params

1. colecmac (a) protonmail.com (colecmac (a) protonmail.com)

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

Link to individual message.

2. colecmac (a) protonmail.com (colecmac (a) protonmail.com)

I found another small error in this section, might as well put it here.

It says:

> Valid values for the "lang" parameter are comma-separated lists of one
> or more language tags as defined in RFC4646.

But RFC4646[1] is obsoleted by RFC5646, which is more commonly known as
BCP47[2]. The spec should be updated to reflect this, saying:

> Valid values for the "lang" parameter are comma-separated lists of one
> or more language tags as defined in BCP47.

It would be nice if it linked to BCP47 as well.

1: https://tools.ietf.org/html/rfc4646
2: https://tools.ietf.org/html/bcp47


Thanks,
makeworld

Link to individual message.

---

Previous Thread: [ANN] Geminiserver ASM

Next Thread: [ANN] A Nagios (and compatible) monitoring plugin for Gemini servers