in reply to Converting string literal represetation of utf to utf8

Is this what you want:
my $a = "\\xC4\\x80"; $a =~ s/\\x([0-9A-Fa-f]+)/chr(hex($1))/ge; utf8::decode($a); printf "length=%d, ord=0x%x\n", length($a), ord($a);
Outputs:
length=1, ord=0x100

Dave.

Replies are listed 'Best First'.
Re^2: Converting string literal represetation of utf to utf8
by djihed (Novice) on Jun 17, 2011 at 14:42 UTC
    Yes, thanks.