in reply to How to write a utf-8 file
General remarks:
1. use three argument open with lexical file handle and exception handling i.e, instead of writing this,
open (IN, "<:encoding(UTF-8)", "D:/wordpress/wordpress.2011-04-12.xml" +);
write like,
open(my $fh, "<:encoding(UTF-8)", "filename") || die "can't open UTF-8 encoded filename: $!";
2. you are trying to parse the xml, dont use regular expresions, better to use XML::Simple or XML::Twig
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to write a utf-8 file
by srikrishnan (Beadle) on Apr 13, 2011 at 05:02 UTC | |
by elef (Friar) on Apr 13, 2011 at 09:43 UTC | |
by SuicideJunkie (Vicar) on Apr 13, 2011 at 15:12 UTC |