News for hackers. Stuff that matters.
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by tialaramex on Wednesday January 08, 2020 @10:30AM (#21992227)
There are a bunch of different human writing systems. All of them are weird because they were invented by humans, most of them are very weird indeed because they were invented by humans a long time ago and then gradually mutated.

The Latin system is the one you're using here. It's very popular. Most humans in the integrated tribes are somewhat familiar with it‡. It has twenty six "letters" and then twenty six more "capital letters" which look different but mean almost the same thing for some reason, and then a bunch more symbols that aren't quite letters although some (apostrophe, ampersand) have a better claim than others. But other popular systems include Han, which has a shitload of logograms, and Cyrillic and Greek which have different letters than Latin and different rules about how letters work.

Anyway, the people who invented DNS only or primarily used the Latin system and they weren't much into capital letters. So, their system doesn't treat capital letters as different and only has one set of twenty six Latin letters, ten digits, a dash and an underscore for some reason.

But, lots of people who do NOT have Latin as the primary or only writing system found this annoying to work with. They wanted to use their writing system with DNS especially once the Web came along and popularized the Internet.

Punycode is a way to use some reserved nonsense-looking Latin text in any DNS label to mean that actually this DNS name should be displayed as some Unicode text. Unicode encodes all popular human writing systems (and lots of unpopular ones) fairly well, so this sorts the problem out. Specifically Punycode reserves Latin names that start xn-- for this purpose. By only caring about display this avoids changing anything in the technical underpinnings. Only user-facing code needed to change, every other layer is unaltered.

The rules about IDNs say that a registry (such as .com) should have rules to ensure the names in that registry are unambigous and meaningful. But in practice the purpose of the .com registry in particular is to make as much money as possible regardless of the consequences. So you can register any name you please and they won't stop you even if it's deliberately confusing.

‡ None of the extant unintegrated tribes have writing. This probably doesn't mean anything important.

Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by downerending on Wednesday January 08, 2020 @12:36PM (#21993709)
Perhaps ironically, URLs were never meant for human consumption in the first place. You were meant to "travel" to various sites via search indices, etc. (Think Google.)

Viewed in that light, restricting DNS names to ASCII as a way to reduce bugs, security issues, etc., makes a lot of sense.

Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by ncmncm on Wednesday January 08, 2020 @01:19PM (#21994180)
Search engines happened remarkably late. Nobody understood how easy search engines would be.

People thought you would follow links from directory pages linked from your "home page", hence the house symbol still seen in browsers. Yahoo! is a leftover of an attempt at a directory.

Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by downerending on Wednesday January 08, 2020 @02:10PM (#21994669)
Indeed--this is what was meant by "indices".

It's kind of like XML. It was never meant to be seen by human eyes, except in a few debugging scenarios. Unfortunately, that intention was ignored, and now we have a usability disaster. (At least in the case of XML, it can just die.)

Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by lokedhs on Wednesday January 08, 2020 @10:20PM (#21998256)
I agree with what you said about XML. But in its stead we have a lot of JSON which is several respects is even worse.

The worst part of it is that it doesn't have a stable definition for numbers, making it impossible to guarantee you're getting the same value back if you encode and then decode a number. Reliably preserving the data you serialise using it should be a primary feature for an encoding format. JSON can't even do that.

Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by gowld on Thursday January 09, 2020 @03:51PM (#22005567)
Why do you need a stable serialization for an unstable data type? Use a string of you want stability.
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by lokedhs on Thursday January 09, 2020 @09:07PM (#22007848)
The point is that a 64-bit integer is stable in the language I'm using (which is most languages).

My opinion is that a serialisation format that explicitly makes something as fundamental as the representation of numbers unspecified is not useful as a data representation format.

Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by LadyCailin on Wednesday January 08, 2020 @02:23PM (#21994792)
Oh man, do you remember aol keywords?
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by downerending on Wednesday January 08, 2020 @02:51PM (#21995063)
And who can forget the original "me too"? :-)
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by WorldMaker on Wednesday January 08, 2020 @02:57PM (#21995111)
It's another reminder how much internet infrastructure predates the Unicode standard (along with other equally wacky hacks like email's UTF-7). URLs weren't restricted to ASCII versus Unicode for any sort of bug reduction/security issue/whatnot, they were restricted to (a subset of) ASCII simply because Unicode did not exist at the time to even be considered.
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by gowld on Thursday January 09, 2020 @03:53PM (#22005604)
Unicode (1987-1991) predates URLs (1990-1994) but not DNS (1983)
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by WorldMaker on Thursday January 09, 2020 @06:18PM (#22006930)
The most critical Unicode date for this sort of discussion is the standardization of UTF-8 (1993), because HTTP (1989) piggy-backed on Telnet (1969), an 8-bit text channel.
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by johnchristopher on Wednesday January 08, 2020 @01:38PM (#21994370)
> You were meant to "travel"

You were meant to surf the web ^^.

Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by johannes1234321 on Wednesday January 08, 2020 @03:19PM (#21995331)
"Surfing" came later afair it's traced back to some Australian librarian who had a surf board on here mousepad while looking for an analogy for an article she wrote. [Citation needed]
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by johannes1234321 on Wednesday January 08, 2020 @03:17PM (#21995314)
I won't judge URLs, but we are talking about DNS and hostnames here, which predate URLs and we're ment to give human-readable names to hosts.
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by gowld on Thursday January 09, 2020 @03:47PM (#22005516)
Citation needed that URLs were never meant to be seen. Every web browser had a location bar.
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by billpg on Wednesday January 08, 2020 @12:24PM (#21993550)
I vaguely recall that the double-hyphen used to be disallowed in domain names, reserving them for future definition. "xn--" becoming that future definition.

I'm having trouble confirming this as the double-hyphen is now very much allowed, thanks to IDN.

Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by anticensor on Wednesday January 08, 2020 @12:42PM (#21993772)
FYI, xn stands for eXtended Names.
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by gowld on Thursday January 09, 2020 @03:45PM (#22005497)
A+ comment except for this part:

> so this sorts the problem out.

Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by nisuni on Wednesday January 08, 2020 @10:37AM (#21992277)
That’s unnecessarily patronizing.
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by nkrisc on Wednesday January 08, 2020 @10:43AM (#21992359)
I thought it was a well thought-out and clearly written answer to a question that comes across as dismissive.
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by jackewiehose on Wednesday January 08, 2020 @11:08AM (#21992614)
Yes, I wrote it this dismissive because I already knew the answer and obviously don't agree with the whole idea but it's a good answer for people who don't know the relationship between emojis and character encodings.
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by davidcollantes on Wednesday January 08, 2020 @11:03AM (#21992566)
Nothing patronising about it. I find it interesting, and educative.
Re:Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost" by Avamander on Wednesday January 08, 2020 @10:27PM (#21998294)
Just like the comments that say "ASCII ought to be enough for everybody"?