-- Leo's gemini proxy

-- Connecting to freeshell.de:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;lang=en-GB

Underscores in host names _

At smol.pub users can create an account with an underscore in the name. That's then used in the host name of their capsule.

For example, ennui_institute.smol.pub


Is an underscore a valid character in a host name? Stack Overflow answers suggest not...

https://stackoverflow.com/questions/7111881/what-are-the-allowed-characters-in-a-subdomain

https://stackoverflow.com/questions/2180465/can-domain-name-subdomains-have-an-underscore-in-it

...but clients seem to be OK with it.


Why do I care? Because my client doesn't cope with underscores in host names. It would have done, but I added support for internationalised names and punycode, and the library method I'm using for puny-encoding complains about non-LDH characters (where LDH is letter, digit, hyphen). Given that other clients are relaxed about underscores, I probably should be too. I was assuming that it was always ok to puny-encode the host because if there's nothing to do it just returns the input. But now I have to insert logic to check if the hostname is "LDH+underscore" first.


Robustness Principle at Gemipedia

(Note the part on why this principle might not be so great)


Oops, tech post! Please return to your normal Gemini programming. 8~)


#punycode

#IDN


back to gemlog

-- Response ended

-- Page fetched on Sat May 4 01:38:22 2024