... could someone explain what is happening, and why?
Its easier to start from the beginning :) you've got too much code in the question, trim it down to absolute minimum, use Data::Dump::dd for generating sample input, and for verifying the encoding of data, deal with just 3 strings, input, wanted output, actual output, and explain what you don't like about actual output
I don't see no problems here, or need to encode/decode anything myself (perlunitut: Unicode in Perl) since libxml knows about encodings
#!/usr/bin/perl -- use warnings; use strict; use XML::LibXML; my $orig = "<?xml version='1.0' encoding=\"ISO-8859-1\" standalone=\"y +es\"?><tag string=\"süße\" />"; my $dom = XML::LibXML->new(qw/ recover 2 /)->load_xml( string => $ori +g ); dd( $orig ); dd( "$dom" ); dd( $dom->findvalue( q{//*/@string } ) ); printf "%v02x\n", $dom->findvalue( q{//*/@string } ); dd( map { ord $_ } split //, $dom->findvalue( q{//*/@string } ) ); __END__ "<?xml version='1.0' encoding=\"ISO-8859-1\" standalone=\"yes\"?><tag +string=\"süße\" />" "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"yes\"?>\n< +tag string=\"s\xC3\xBC\xC3\x9Fe\"/>\n" "s\xC3\xBC\xC3\x9Fe" 73.c3.bc.c3.9f.65 (115, 195, 188, 195, 159, 101)
In reply to Re: Encode double encoding?
by Anonymous Monk
in thread Encode double encoding?
by DrkShadow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |