Special characters in domain names

I recently purchased maña.com. The domain's name is causing problems in some forms. For example, if I try to add it to Firebase authorised authentication domains, I get an invalid domain error:

Invalid domain name special characters

If domains accept only ASCII characters, why you can type https://maña.com and go to the site without any problems? Well, modern browsers use Punycode to transform the special characters into a Unicode string.

For example, in the case of https://maña.com, the URL is https://xn--maa-8ma.com in Punycode (see how the ñ is encoded). Try to paste the latter URL in your browser to see what happens. Yes, both URLs are equivalent. To summarise, if you want to avoid specials characters in URLs, use a Punycode converter.

Hi, I'm Erik, an engineer from Barcelona. If you like the post or have any comments, say hi.