Skip to content

Instantly share code, notes, and snippets.

@onishi
Created June 29, 2011 05:33
Show Gist options
  • Save onishi/1053219 to your computer and use it in GitHub Desktop.
Save onishi/1053219 to your computer and use it in GitHub Desktop.
decode_punycode
use IDNA::Punycode;
use Encode;
idn_prefix('xn--');
decode_punycode('xn--cho'); #=> '䑵'
decode_punycode('xn--motemen'); #=> '嵡嵣嵫嵧嵨'
decode_punycode('xn--hitode'); #=> '岴岊岲'
decode_punycode('xn--hakobe932'); #=> IDNA::Punycode が落ちて abort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment