in reply to Encode throws "Wide character in subroutine entry" when using XML::Simple
This works for me.
D:\>file Simple.xml Simple.xml: Text file, UTF-8 format D:\>cat Simple.xml <?xml version="1.0" encoding="UTF-8"?> <root> <foo> bar </foo> </root> D:\>od -h Simple.xml | head -1 | cut -c 1-24 0000000000 EF BB BF D:\>cat Simple.pl #!perl use strict; use warnings; use XML::Simple; local $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; my $file = shift @ARGV; my $xml = XMLin($file, ForceArray => ['map'], KeyAttr => {}); D:\>perl Simple.pl Simple.xml D:\>perl -v | head -8 | fmt -w 68 This is perl 5, version 12, subversion 2 (v5.12.2) built for MSWin32-x86-multi-thread (with 8 registered patches, see perl -V for more detail) Copyright 1987-2010, Larry Wall Binary build 1202 [293621] provided by ActiveState http://www.ActiveState.com Built Sep 6 2010 23:36:03 D:\>
Simple.xml is a simple XML document in the UTF-8 character encoding scheme of the Unicode coded character set. It has a UTF-8 byte order mark in it. XML::Simple handles the XML document properly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Encode throws "Wide character in subroutine entry" when using XML::Simple
by Anonymous Monk on Sep 10, 2012 at 15:03 UTC |