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.
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.
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>
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; }
Internationalized domain name (i.e. domain names with non-ASCII characters) are encoded using the Punycode system.
You encode and decode IDNA with Python:
>>> print u'παιχνιδια'.encode('idna')
xn--mxaaitabzv9d
>>> print 'xn--mxaaitabzv9d'.decode('idna')
παιχνιδια