setEncoding function

Christian Orsatti <[email protected]>
Newsgroups gmane.text.xml.xerces-p.devel
Message-ID <[email protected]>
Hi

An other problem that I face.
I can't set the encding to "ISO-8859-1"
It is always "UTF-16"
Why ?

My code is:
my $impl = 
XML::Xerces::DOMImplementationRegistry::getDOMImplementation("LS");
#### Create a DOM writer
my $serializer = $impl->createDOMWriter();
$serializer->setEncoding("$XML::Xerces::XMLUni::fgISO88591EncodingString");

my $dt = eval{$impl->createDocumentType('PhysicalEntity', 'no', 
'PhysicalEntity.dtd')};
($@) and die ($@);

my $doc = eval{$impl->createDocument('', 'PhysicalEntity',$dt)};
($@) and die ($@);

$doc->setEncoding("\*XML::Xerces::XMLUni::fgISO88591EncodingString");
my $str = $serializer->writeToString($doc);

print STDERR "\n\n$str\n\n";

and I have the result:

<?xml version="1.0" encoding="UTF-16" standalone="no" ?><!DOCTYPE 
PhysicalEntity PUBLIC "no" "PhysicalEntity.dtd"><PhysicalEntity/>

I have try alse set ActualEncoding but it change nothing

thanks for your help

Christian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.