It won't work if the argument to encode() is in LATIN-1, and your XML file is UTF-8.
update:... hmmmmmm it appears that the "most reasonable" approach would be simply
and do the character encoding seperately using Encode, or let the filehandle figure it out.sub encode { my $arg = shift; $arg =~ s/&/&/g $arg =~ s/</</g; $arg; }
In reply to Re^2: creating an XML string
by Joost
in thread creating an XML string
by esharris
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |