clintonm9 has asked for the wisdom of the Perl Monks concerning the following question:
I am having some unicode issues with XML::Simple. I have wrote a test program to show my problem
#!/usr/bin/perl use strict; use utf8; # A simple test to show the UTF8 problem my $parameters; push (@{ $parameters->{Request} }, { URI => '/HRM/EmploymentManager/AvailableOpening +s', Action => 'GET', ID => '123', Parameters => { Status => 'Test', }, }); # convert Perl hash ref into XML my $xs = XML::Simple->new(); my $x = $xs->XMLout($parameters, KeepRoot => 0, RootName => 'Requests' +); print $x; # convert XML into Perl hash ref my $xs = XML::Simple->new(); my $XML = $xs->XMLin($x,ForceArray => 0); # Look at the perl hash ref, there shouldnt be any my $temp = $XML->{'Request'}->{'Action'}; my $flag = utf8::is_utf8($temp); print "$flag ! $temp\n\n\n"; exit;
I am trying to use iso-8859-1 and not use UTF8. Any ideas why the UTF8 Flag is on and to make XML::Simple not make UTF8 when sending iso-8859-1 in the headers
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: UTF8 and XML
by ikegami (Patriarch) on Mar 08, 2010 at 23:43 UTC | |
|
Re: UTF8 and XML
by ikegami (Patriarch) on Mar 09, 2010 at 00:06 UTC | |
by clintonm9 (Sexton) on Mar 09, 2010 at 03:15 UTC | |
by ikegami (Patriarch) on Mar 09, 2010 at 05:21 UTC |