| 1 |
use utf8; |
| 2 |
use strict; |
| 3 |
|
| 4 |
use Test::More tests => 17; |
| 5 |
use Test::NoWarnings; |
| 6 |
|
| 7 |
use IDNA::Punycode; |
| 8 |
|
| 9 |
is(encode_punycode('faerber'),'faerber'); |
| 10 |
is(encode_punycode('xn--frber-gra'),'xn--frber-gra'); |
| 11 |
is(encode_punycode('färber'),'xn--frber-gra'); |
| 12 |
is(encode_punycode('中央大学'),'xn--fiq80yua78t'); |
| 13 |
|
| 14 |
is(decode_punycode('faerber'),'faerber'); |
| 15 |
is(decode_punycode('xn--frber-gra'),'färber'); |
| 16 |
is(decode_punycode('färber'),'färber'); |
| 17 |
is(decode_punycode('xn--fiq80yua78t'),'中央大学'); |
| 18 |
|
| 19 |
idn_prefix('yo--'); # yo, man |
| 20 |
|
| 21 |
is(encode_punycode('faerber'),'faerber'); |
| 22 |
is(encode_punycode('yo--frber-gra'),'yo--frber-gra'); |
| 23 |
is(encode_punycode('färber'),'yo--frber-gra'); |
| 24 |
is(encode_punycode('中央大学'),'yo--fiq80yua78t'); |
| 25 |
|
| 26 |
is(decode_punycode('faerber'),'faerber'); |
| 27 |
is(decode_punycode('yo--frber-gra'),'färber'); |
| 28 |
is(decode_punycode('färber'),'färber'); |
| 29 |
is(decode_punycode('yo--fiq80yua78t'),'中央大学'); |