in reply to XML::DOM encodes in latin1 instead of UTF-8

I think this is a bug in XML::DOM. A work-around is to print to a string and then output it yourself with the correct I/O layers in place:
my $doc = $parser->parsefile("$srcdir/$_"); my $output = $parser->toString; open(my $out, ">:utf8", "$dstdir/$_") or die "..."; print $out $output; close($out);