IDN with Gemini?

Philip Linde linde.philip at gmail.com
Tue Dec 8 11:42:29 GMT 2020


On Tue, 8 Dec 2020 11:29:24 +0100
Stephane Bortzmeyer <stephane at sources.org> wrote:

> For Python (a common programming language), this is not true, standard
> library's urlparse has no problem:

Similar results in Go:


--- code
package main

import (
	"fmt"
	"net/url"
	"os"
)

func main() {
	for _, arg := range os.Args[1:] {
		u, err := url.Parse(arg)
		if err != nil {
			panic(err)
		}
		fmt.Printf("%q %q %q\n", u.Hostname(), u.Path, u.Query)
	}
}
---

However, this still leaves the problem of punycoding and worse,
normalization, to some other piece of code. In Go, normalization is in
the text package. ToASCII/ToUnicode implementations are in 
golang.org/x/net/idna

Not sure if Python will normalize by default.

-- 
Philip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20201208/fc404c5c/attachment-0001.sig>


More information about the Gemini mailing list