purl’s posterous

« Back to blog

Useful Unicode Modules

joe@flatpan:~$ psh
psh% use Encode
psh% use Unicode::Unihan;
psh% $uh=Unicode::Unihan->new;
psh% print $uh->ZVariant( decode ('utf8', '聯') )
U+8068
psh% use Unicode::String qw(uhex)
psh% print uhex $uh->ZVariant( decode ('utf8', '聯') )

psh% echo 聯 | od -x
0000000 a6ef 0a97
0000004
psh% print uhex $uh->ZVariant( decode ('utf8', '
') ) | od -x
0000000 81e8 00a8
0000003

Comments (0)

Leave a comment...

 
To leave a comment on this posterous, please login by clicking one of the following.
Posterous-login     Connect     twitter