Subject: | Fails for UTF-16 files with encoding="UTF-16" |
$ od -c sample.xml | head -n 5
0000000 377 376 < \0 ? \0 x \0 m \0 l \0 \0 v \0
0000020 e \0 r \0 s \0 i \0 o \0 n \0 = \0 " \0
0000040 1 \0 . \0 0 \0 " \0 \0 e \0 n \0 c \0
0000060 o \0 d \0 i \0 n \0 g \0 = \0 " \0 U \0
0000100 T \0 F \0 - \0 1 \0 6 \0 " \0 ? \0 > \0
Parsing the above file (via XML::Simple) results in
UTF-16:Unrecognised BOM 3f3e at /usr/lib/perl/5.8/Encode.pm line 166.
3F = ?
3E = >
Two problems:
- It shouldn't look for a BOM at that location.
- It's trying to decode what's already been decoded (since the error
message doesn't say 3f00)