Question About Link Format
Alex Schroeder
alex at gnu.org
Fri Jul 17 11:52:43 BST 2020
On Fri, 2020-07-17 at 13:51 +0430, Ben wrote:
> It does seem a proper URI should best contain %C4%9D in place of ĝ,
> but
> the question is whether I should change it in the document? Does the
> internal linking (in my case the link is local/relative) even count
> as a
> URI?
I think you should change it to %C4%9D; otherwise you're relying on
clients to do it for you (which might work). But in the example you
give, the stuff after => is a URL, just not an absolute one. It's a
relative URL and the client is supposed to know how to combine it with
the URL of our current URL and to request this document if the user
wants to follow the link. So if the current URL is
gemini://example.org/foo/bar then following the link below will take
the user to gemini://example.org/foo/logarion/ta%C4%9Dikio.
=> logarion/taĝikio--lando-montara.gmi Taĝikio: Lando Montara
A good way to think about this would be spaces in file names. Assume
the filename is "taĝikio: lando montara.gmi". What would you write?
This won't work:
=> logarion/taĝikio: lando montara.gmi Taĝikio: Lando Montara
If you escape the spaces, why not escape the rest that needs escaping?
=> logarion/taĝikio:%20lando%20montara.gmi Taĝikio: Lando Montara
That's how I reason about it. Or if you want to go all-in, RFC 3986 has
you covered. The only characters that unambiguously never have to
escaped, no matter where they appear, are the unreserved ones:
Characters that are allowed in a URI but do not have a reserved
purpose are called unreserved. These include uppercase and
lowercase letters, decimal digits, hyphen, period, underscore,
and tilde.
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
https://tools.ietf.org/html/rfc3986#section-2.3
And to be clear, ALPHA means a-z and A-Z, nothing else.
Cheers
Alex
More information about the Gemini
mailing list