rikkimax / alphaPhobos

Assume License: Boost
11 stars 1 forks source link

uri: punycode support #2

Open dhasenan opened 8 years ago

dhasenan commented 8 years ago

Punycode is a way to encode arbitrary Unicode codepoints using ASCII. It's used for international domain names. Not supporting Punycode means an appreciable fraction of the Internet is pretty difficult to reach, if you want to have people enter something reasonably readable and get where they want to go.

For instance, the punycode encoding of "ﻞﻴﻬﻣﺎﺒﺘﻜﻠﻣﻮﺸﻋﺮﺒﻳ؟" is "xn--egbpdaj6bu4bxfgehfvwxn". A human cannot reasonably interpret between the two, so it is unacceptable for me to ask my users to enter the puny-encoded version of a URL.

rikkimax commented 8 years ago

I've had a bit of a think and looked into Punycode a bit more. It is a form of encoding meant for domain names. As such given its broad usage and non URI specific code, I won't be adding it to std.experimental.uri.

However, if you are interested in taking ownership of a std.experimental.punycode I would be happy to write it. You would be change of getting it into Phobos should you want to.