in reply to Re: How to to get chinese charactor from unicode?
in thread How to to get chinese charactor from unicode?

I wasn't too happy with the second snippet. It had no way of escaping \. This is a fix:

my $out = ''; for ($in) { /\G ([^\\]+) /xgc && ( $out .= $1 ); /\G \\u([0-9A-Fa-f]{4})/xgc && do { $out .= chr(hex($1)); redo; }; /\G \\(.) /xgc && do { $out .= $1; redo; }; }