in reply to error parsing utf8 chars using XML DOM parser
You need to make sure your output is in UTF8 too, otherwise you'll get Perl's internal codes.
If writing to a normal file, you can just specify utf8 encoding:
open(my $fh, '>:utf8', 'out.xml') || die "Failed to open file"; print $fh $str; close($fh) || die "Failed to close file";
For STDOUT, specify your default output files will be in utf8 and that this should apply to STD* handles too
use XML::DOM; use open OUT => ':utf8'; use open ':std'; # as before... print $str;
See "perldoc open" for some discussion.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: error parsing utf8 chars using XML DOM parser
by avih (Initiate) on Nov 01, 2011 at 17:31 UTC | |
by choroba (Cardinal) on Nov 01, 2011 at 18:04 UTC | |
by avih (Initiate) on Nov 03, 2011 at 08:25 UTC |