my $str = '\u00E1\u015F'; $str =~ s/\\u([0-9a-fA-F]{4,6})/chr(hex($1))/eg; open my $handle, '>:encoding(UTF-8)', $file or die "Can't open file `$file' for writing: $!"; print $handle $str; close $handle or warn $!;
See also Character encodings and Unicode in Perl.
In reply to Re: Unicode encoding
by moritz
in thread Unicode encoding
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |