Hi ikegami
I've tried selecting utf8 in editor menus and inserting a BOM but neither has seemingly worked. I think my files are coming out windows-1252 encoded because without runnig the code you provided and just changing the 1st line to
<?xml version="1.0" encoding="windows-1252"?>results in me being able to open the file OK
What is confusing me is that running the code below
#!/bin/perl -w use XML::DOM; use PerlIO::encoding; my $parser = new XML::DOM::Parser; my $doc = $parser->parsefile ("c:\\accentTest.xml", ProtocolEncoding = +> 'UTF-8'); # Print doc file $doc->printToFile ("c:\\accentTestOutPut.xml"); open my $fh, ">:encoding(UTF-8)", "accentTestOutPut.xml" or die $!; $doc->print($fh); $doc->dispose;
In windows results in a file (that to my untrained eye) appears to not be UTF8 encoded (in hex I do not see the C3 A9 for the e-acute) and will not open without the above mentioned 1st line change, however
If I run the same code in Unix and open the resulting file in windows its all fine. It appears properly utf8 encoded and viewing the file in hex shows the C3 A9 expected for the e-acute
At the moment I'm not understanding why the problem is with the editors (not saying it isn't just don't understand why yet). Whats confusing me is the file created using the same code on Unix opens without issue?
In reply to Re^2: XML:: DOM and Accented Characters
by freeflyer
in thread XML:: DOM and Accented Characters
by freeflyer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |