Hi
I don't manage to build an XML::DOM object
with french characters. In the XML::DOM::Parser
documentation, it says that the characters are encoded
in utf-8 characterset during the parsing.
The problem is that this module doesn't seem to support non-american characters,because when I convert my XML::DOM::Document object to a string, only the attributes
are encoded in UTF-8 and they are not always well encoded.
Moreover, when i use the: ProtocolEncoding=>'ISO-8859-1' option in the XML::DOM::Parser constructor, my output
is not the same as my input.
Does anybody manage to make the XML::Parser module
compliant with non ASCII characters? Am I missing
something? I really need your help.
Here is a code example,
use XML::DOM;
my $parser = new XML::DOM::Parser;
my $xmlstring="<?xml version='1\.0'?>
<ACTION>
<INPUT LABEL=\"Radio Button\"/>
<INPUT LABEL=\"été\"/>
<RADIO ID=\"List\">
éééàààùùù</RADIO>
</ACTION>";
my $doc;
eval {
$doc = $parser->parse($xmlstring);
};
if ($@) {
die "ERROR : $@\n";
}
print $doc->toString;
Thanks,
Luc
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.