Hello,
I am trying to work with a XML document and having some encoding-type issues with it.
First, this is the first few bytes of the XML document passed through "od -c":
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
0000120 \r \0 \n \0 < \0 l \0 i \0 s \0 t \0 i \
+0
0000140 n \0 g \0 _ \0 f \0 e \0 e \0 d \0 > \
+0
0000160 \r \0 \n
Of relevance here, I suppose, is that it is encoding="utf-16", which appears to me the XML document is correctly formed, although I am certainly no expert in this area.
In plain ASCII, this would look something like:
<?xml version="1.0" encoding="utf-16"?>
<listing_feed>
Now, I'm trying to do a regular expression match on this string, like so:
if($string =~ m/xml/)
{
...
}
.. but this does not work... However, this does:
if($string =~ m/x.m.l./)
{
...
}
Have I completely misunderstood that this type of regular expression match should work? I've tried using the "Encode" module to re-code this to UTF-8, or even ASCII but nothing I do can make this work.
.. I think I must be missing something obvious here...
- dEvNuL