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
3
votes
1 answer

DotNet 5.0 IdnMapping.GetAscii throws ArgumentException

I wrote an example console application: Get current DotNet version Then get ASCII from latine string (each label equals to or less 63 symbols long, total string length (including dots) is 254 symbols long) static void Main(string[] args) { …
3
votes
1 answer

Java Punycode String

I want to punycode a String in order to generate a csr using bouncycastle. Here I need the byte representation of the domain name. E.g new GeneralName(GeneralName.dNSName, new DEROctetString(bytes..)) My question is: How do I encode www..tld…
user3046582
  • 341
  • 3
  • 15
3
votes
1 answer

How can i code and decode urls from IDN in php?

im doing a site to check, register, etc of domains, i have to make it IDN compliant. Right now i have something like this: echo $domain; $domain = idn_to_ascii($domain); echo $domain; $domain = idn_to_utf8($domain); echo $domain; and im…
Juan Techera
  • 1,192
  • 2
  • 14
  • 25
3
votes
1 answer

Punycode for Unicode query parameter

I am trying encode some Unicode URLs with Punycode. These URLs have a query parameter that contains non-ASCII characters, for example: https://en.wiktionary.org/w/index.php?title=Clœlia&printable=yes The problem is, when I try to do it in Java, the…
Chin
  • 19,717
  • 37
  • 107
  • 164
3
votes
1 answer

How to detect homographic text, unicode spoofing with node.js

Users can get their own subsites on ours, so that www.example.com/subsite/gary would then be a specific users subsite. However I am worried about the possibility of homographic / unicode spoofing attacks, where a malicious user creates an account…
user254694
  • 1,461
  • 2
  • 23
  • 46
3
votes
3 answers

Convert non-ascii domain to SMTP compatible

When customers enter email addresses with non-ascii chars like äüö our SMTP rejects to process them. So I think might be there is a solution to handle those domains myself and convert them to punyocode. Is there a simple way of doing so using…
kcode
  • 1,220
  • 1
  • 18
  • 34
2
votes
0 answers

punycode is deprecated in npm - what should I replace it with?

I'm using the npm module punycode in my Angular project. VsCode tells me it's deprecated and https://nodejs.org/api/punycode.html#punycode_punycode confirms: The version of the punycode module bundled in Node.js is being deprecated. In a future…
Ben Taliadoros
  • 7,003
  • 15
  • 60
  • 97
2
votes
2 answers

Any way to show IDNs correctly?

I've made a Portfolio Website and chose to use a Domain with cyrillic characters. Sadly, it's being displayed as "xn--80afg8d.me", which is ugly as hell. Is there any way to make browsers display it correctly? Does the same thing happen with other…
mirnanoc
  • 21
  • 2
2
votes
0 answers

DNS resolution failure with Unicode host name

Recently, a strange bug has popped up with some clients of ours. After some deep diving into the logs provided by unity's developer console build, I've come across the following error: SocketException: Could not resolve host 'ן§¹ב· ו·©' I've traced…
2
votes
0 answers

converting escaped urls with punycode to utf, refactoring

I want to store all my url in readble utf8 class User < ActiveRecord::Base require 'addressable/uri' require 'idn' include IDN def service_url=(url) url = Addressable::URI.parse Addressable::URI.unescape(url) url.host =…
Oleg German
  • 135
  • 1
  • 6
2
votes
2 answers

Perl: Homograph attacks. It is possible to compare ascii / non-ascii strings, visually similar?

I faced this so called "homograph attack" and I want to reject domains where decoded punycode visually seems to be alphanumeric only. For example, www.xn--80ak6aa92e.com will display www.apple.com in browser (Firefox). Domains are visually the same,…
Claude
  • 171
  • 10
2
votes
1 answer

Punycode converter at C#

I need a punycode converter for Silverlight. For WPF have such an opportunity in the standard libraries. I need a ready-made library or code of functions (punycode encoding and decoding) {C#, Silverlight}.
Sergey
  • 21
  • 2
2
votes
2 answers

Valid domain name registration for Unicode characters

I'm trying to figure out what is valid for domain name registration, apparently some Unicode characters are translated weirdly while others do not at all. This address: http://xn--ippleman-dmj.com/ Translates…
johnny 5
  • 19,893
  • 50
  • 121
  • 195
2
votes
1 answer

MSXML2.ServerXMLHTTP and national characters

This question is related to this one: Character encoding Microsoft.XmlHttp in Vbscript, but differs in one thing, the national characters are in the domain name, not only arguments. The task is: download a page from the given URL. I already solved…
Denis K.
  • 23
  • 5
2
votes
4 answers

How to check if a domain is punycode or not?

Well, I use the idna_convert PHP class (http://idnaconv.net/index.html) in order to encode / decode domain names. Unfortunately, it doesn't seem to provide an interface to check whether a domain name is already punycode or not. What's the best way…
Andreas
  • 2,821
  • 25
  • 30