in reply to XML Parser encoding problem (was: XML::Parser)

As mentionned in the docs XML::Parser converts all the text it parses to UTF-8. You have several solutions to get the original encoding back: use the $p->original_string() method to get the text, or convert the UTF-8 back to ISO-8859-1 (BTW, are you sure you want to use this encoding? If you are dealing with scandinavian text you might need ISO-8859-4 to get all the characters you need). If your system has the iconv library (*nix or MS-Windows with cygwin) then you can use the Text::Iconv module.

<plug type="shameless">You can also use XML::Twig in keep_encoding mode or with an input filter to get the dat in the required encoding:

#!/bin/perl -w use strict; use XML::Twig; my $t = new XML::Twig(input_filter => 'latin1'); $t->parse( \*DATA); print "content: ", $t->root->text, "\n"; __DATA__ <?xml version="1.0" encoding="ISO-8859-1"?> <doc>Humörsvängningar</doc>

</plug>

BTW, try not to use module names as the title of a node, as this might interfere with the review of the module, try "XML::Parser encoding problem" for example.