1

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

5 Answers5

2

If you want to do it inside your browser, save the code in this answer as puny.js and the code below to puny.html, then load the file in your browser.

<html>
    <title>Punyconverter</title>
    <script type="text/javascript" src="puny.js"></script>
    <style type="text/css">
        input {width:300px;}
        label {width:100px; display:inline-block;}
    </style>
    <script type="text/javascript">
        onload = function( ) {
            var ASCII = document.getElementById("ASCII");
            var Unicode = document.getElementById("Unicode");
            var Input = document.getElementById("Input");

            Input.onkeyup=function(){
                ASCII.value = punycode.ToASCII( this.value);
                Unicode.value = punycode.ToUnicode( this.value);
            }
        };
    </script>
</html>
<body>
    <h1>Convert puny coded IDN</h1>
    <div><label for="Input">Input</label><input id="Input" type="text"></div>
    <div><label for="ASCII">ASCII</label><input id="ASCII" type="text" readonly="readonly"></div>
    <div><label for="Unicode">Unicode</label><input id="Unicode" type="text" readonly="readonly"></div>
</body>
Community
  • 1
  • 1
some
  • 48,070
  • 14
  • 77
  • 93
1

The standard modules in Perl also in Apache can do it with the URI module.

use URI;
#insert sitename in next:
$sitename = "..";
my $uri = URI->new( $sitename,'http');
if ($uri->scheme) { print $uri; }
A.T.
  • 11
  • 1
1

You can use any tool that supports "Libidn". A quick search showed SimpleDNS might be of help to you.

There are heaps of converters for IDN online, if that's enough for you, you can use one of them.

halfdan
  • 33,545
  • 8
  • 78
  • 87
1

Internationalized domain name (i.e. domain names with non-ASCII characters) are encoded using the Punycode system.

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
1

You encode and decode IDNA with Python:

>>> print u'παιχνιδια'.encode('idna')
xn--mxaaitabzv9d
>>> print 'xn--mxaaitabzv9d'.decode('idna')
παιχνιδια
Josh Lee
  • 171,072
  • 38
  • 269
  • 275