XML::Twig produces double encoded UTF-8



Hi,

I have problem with XML::Twig (Fedora 6).

When parsing and UTF-8 encoded xml file, I am getting double encoded file in the output.

The header is

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE PICTURELIST SYSTEM "dtd/obrazky.dtd">
<!-- p: LANG - defaultni kod jazyka pro TXT -->


and the XML::Twig is build by

my $t= XML::Twig->new(
keep_encoding => 1,
twig_handlers =>
{ PICTURE => \&picture,
},
);
$t->parsefile($xmlobr);
$t->purge;

------------------

The picture sub uses print to output some parts of the "picture" (which is xml structure, no binaray) to STDOUT.

No matter of the keep_encoding option (even if left out) the problem persists.

Is there any other way to tell the parser to keep the encoding untouched?

Thanks,
Josef
.