Re: XML::Twig produces double encoded UTF-8
- From: Josef Feit <jfeit@xxxxxxxxxxx>
- Date: Sat, 13 Jan 2007 17:51:36 GMT
mirod wrote:
On Jan 4, 3:36 pm, Josef Feit <j...@xxxxxxxxxxx> wrote:I have problem with XML::Twig (Fedora 6).
When parsing and UTF-8 encoded xml file, I am getting double
encoded file in the output.
Hi,
That's unusual. Encoding problems are always a pain. The problem could
come from
the LANG environment variable, what is it set to? Did you try opening
the output file as
utf8 (see perldoc perlunicode). What's your version of perl BTW?
It is v5.8.8
echo $LANG: cs_CZ.UTF-8
echo $PERL_UNICODE: 1
I still do not know why the perl doubleencoded the strings.
Maybe I have some leftover iso88592 characters in the input.
The
binmode(STDOUT, ":utf8");
seems to work, however.
Sometimes I have observed similar problem (which was not XML::Twig specific) when some perl script was used as a filter from vi (gvim). Working with the file from the shell was OK, from vi doubleencoded characters were returned.
Again, the binmode seems to remove the problem.
I will try the perldoc perlunicode.
Thank you
Josef
.
- References:
- XML::Twig produces double encoded UTF-8
- From: Josef Feit
- Re: XML::Twig produces double encoded UTF-8
- From: mirod
- XML::Twig produces double encoded UTF-8
- Prev by Date: Re: Uninstalling Perl modules
- Next by Date: Re: XML::Twig produces double encoded UTF-8
- Previous by thread: Re: XML::Twig produces double encoded UTF-8
- Next by thread: Re: XML::Twig produces double encoded UTF-8
- Index(es):