|
Posted by Joost Diepenmaat on February 18, 2008, 6:17 am
Please log in for more thread options
> i'd like to know if there's a way to get back the original hex values
> of a unicode character.
> ex:
> my $u = "\x";
> my $h = pack(....., $u) ? so that $h is now a string '20A3'. thanks.
my $h = sprintf("%X",ord($u));
There's probably some way to do this using (un)pack, but I doubt it's much
more efficient if you're going at it char-by-char.
--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
|