Subject: | XML::Simple doesn't encode unprintable characters |
XML::Simple doesn't encode unprintable characters and therefore generates invalid XML:
XML::Simple isn't escaping the characters, hence the invalid XML being generated. See the example code below:
#!/usr/bin/perl -w
use strict;
use XML::Simple;
my $conf;
$conf->{baz}[0] = "foo\x07bar";
print XMLout($conf, keyattr => ['']);
./testxml | xmllint --noout -
-:2: parser error : PCDATA invalid Char value 7
<baz>foobar</baz>
^