use strict; use warnings; use Unicode::Map(); use XML::Simple; my $string = ''; # Convert to utf-16 my $map = new Unicode::Map("ISO-8859-1"); my $utf16 = $map->to_unicode($string); # Recommended to call XMLin using 'eval', to trap errors my $ref = eval { XMLin($utf16) }; $@ and die "An error occurred in XMLin: '$@'\n"; # Now you can use '$ref' ... my $out = XMLout($ref); print "XMLout => '$out'\n";