https://github.com/wealandwoe/punicode.js/blob/master/punycode-2.0.0.c