Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to convert a few Unicode words to an International Domain Name, (and back) but can't find a script or other resource to do it on a Windows PC.

Does anyone have such a tool?

share|improve this question

put on hold as off-topic by HopelessN00b yesterday

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

instead of punycode as @ignacio-vazquez-abrams said, much better using 'idna' which will give you a better translation (it includes 'xn--' code) that would be:

>>>> u'español'.encode('idna')
'xn--espaol-zwa'

P.S.: wanted to comment on his response, but I couldn't :S

share|improve this answer

Python does it natively.

>>> u'あら?'.encode('punycode')
'l8jxh6512d'
>>> print 'p8j2bk2072s'.decode('punycode')
そうだ!
share|improve this answer
    
Very cool example!! and i love python!! +1 –  Arenstar Nov 13 '10 at 18:00
2  
PS: You need to add xn- in front of what python outputs you. GNU has a Punycode library for C/C++ and C# also. –  Quandary Nov 13 '10 at 18:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.