Questions tagged [punycode]

Punycode is a encoding syntax by which a Unicode (UTF-8) string of characters can be translated into the basic ASCII-characters permitted in network host names. Examples: mañana.com, bücher.com and café.com.

Punycode is a encoding syntax by which a Unicode (UTF-8) string of characters can be translated into the basic ASCII-characters permitted in network host names. Punycode is used for internationalized domain names, in short IDN or IDNA (Internationalizing Domain Names in Applications).

For example, when you would type café.com in your browser, your browser (which is the IDNA-enabled application) first converts the string to punycode "xn--caf-dma.com", because the character 'é' is not allowed in regular domain names. Punycode domains won't work in older browsers.

Examples:

  • mañana.com
  • bücher.com
  • café.com.
80 questions
2
votes
1 answer

Why/how does the browser decide ☃.net goes to xn--n3h.net

If we type into firefox or chrome http://☃.net/ It takes us to http://xn--n3h.net/ Which is a mirror of unicodesnowmanforyou.com What I don't understand is by what rules the unicode snowman can decode to xn--n3h, it doesn't look anything like…
wim
  • 338,267
  • 99
  • 616
  • 750
2
votes
1 answer

How do I handle utf-8 vs. punycode issues in Django's csrf middleware?

I have a domain with non-ascii characters similar to http://blå.no The domain is registered with its punycode equivalent: xn--bl-zia.no which is also set in the Apache vhost: ServerName xn--bl-zia.no ... The problem I'm…
thebjorn
  • 26,297
  • 11
  • 96
  • 138
2
votes
6 answers

Efficient way to ASCII encode UTF-8

I'm looking for a simple and efficient way to store UTF-8 strings in ASCII-7. With efficient I mean the following: all ASCII alphanumeric chars in the input should stay the same ASCII alphanumeric chars in the output the resulting string should be…
Andreas Gohr
  • 4,617
  • 5
  • 28
  • 45
2
votes
1 answer

404 on custom IDN (internationalized domain name) on Azure site

It worked fine to add the punyencoded IDN name to the custom domain list, but my server does not repsond to requests and instead I get a default Azure Error "404 - Web Site not found!" page (indicating that the request at least goes to Azure). Does…
bang
  • 4,982
  • 1
  • 24
  • 28
1
vote
3 answers

Delphi: Punicode Decode

Found the information as encoded in Punycode: Cyrillic domain name , but but how do I decode back (punycode in cyrillic)?
dedoki
  • 709
  • 4
  • 14
  • 24
1
vote
1 answer

Punycode domains doesn't work with requests

Is there an easy way to fetch punycode domains? I tried using the requests module, but it didn't work. The following code doesn't work: import requests requests.get("https://.la") InvalidURL: Failed to parse: https://.la using Python 3.10.4,…
Aviv
  • 11
  • 1
1
vote
2 answers

Does Cocoa's CFHost support IDNs?

WINAPI has methods to convert Unicode host names to Punycode. Does Cocoa/Cocoa Touch have a similar mechanism?
Plumenator
  • 1,682
  • 3
  • 20
  • 49
1
vote
0 answers

NGINX punycode domain only works with subdomain

I have a nginx 1.14.0 on Ubuntu 18.04.3. I have some trouble with a punycode domain, it works only with subdomains, e.g. www.xn--bratwrste-u9a.de but not with the domain only e.g xn--bratwrste-u9a.de Other domains e.g. example.com are working as…
Sebastian
  • 21
  • 3
1
vote
2 answers

Punycode... with Perl

With bash: $ echo '\u043f\u0441\u0438\u0445\u043e\u0442\u0435\u0440\u0430\u043f\u0438\u044f.net' | ascii2uni -a U -q психотерапия.net How can make this with perl? use utf8; use URI::_punycode (decode_punycode,encode_punycode); $fqdn =…
Alfons
  • 311
  • 1
  • 8
  • 17
1
vote
1 answer

QString from Punycode QUrl

If I put url http://www.äsdf.de/bla/bla into QUrl, how can I then restore url with original symbols? It's ok that QUrl will fix some characters, but I'd like to display original äsdf in url instead of xn--sdf-pla. I am aware about QString…
ilya
  • 1,103
  • 14
  • 36
1
vote
5 answers

How to convert domain names with greek characters to an ascii URL?

For example: When typing παιχνιδια.com into Firefox, it is automatically converted to xn--kxadblxczv9d.com Please suggest a tool for making such a conversion. One of the easiest is this. Converts and checks for availability at the same time.
Panagiotis Panagi
  • 9,927
  • 7
  • 55
  • 103
1
vote
0 answers

Excel VBA Punycode Support for International Domain Names (IDNA2003, IDNA2008, and UTS46)

Does Excel VBA provide any sort of method, function, or API for Punycode or converting to and from Unicode/Ascii for Internationalized Domain Names? I was able to find a JavaScript version (below) which seems to work for IDNA2008 Standards. I am…
B Hart
  • 1,108
  • 11
  • 20
1
vote
1 answer

Replace hostname in Node.js + Express.js to decode punycode domain

I'm developing a web-app on a cyrillic domain. Currently, this domain hosts a "parked page", saying the site is under construction. If I access it in Chrome, I see punycode in the address bar. Safari decodes it, though. For the development purposes,…
Anton Egorov
  • 1,328
  • 1
  • 16
  • 33
1
vote
1 answer

How does punycode distinguish similar IRIs?

I've been looking into internationalised resource identifiers and there's one thing bugging me. My understanding is that, for each label in a domain name (xyzzy.plugh.com has three labels, xyzzy, plugh and com), the following process is performed to…
paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
1
vote
0 answers

php filter_var unicode domains

I am writing validation form, and using standart php function "filter_var" with FILTER_VALIDATE_EMAIL, but it seems that above mentioned function does not work with unicode domains such as .рф, after reading some articles tried to encode with…
Velaro
  • 461
  • 1
  • 3
  • 20