Loading ...
Sorry, an error occurred while loading the content.

How to deal with latin1 chars when xml decln says utf-8?

Expand Messages
  • ericpromislow
    I ve been using SOAP::Lite to talk to the amazon.com web services. But this envelop returns some XML that XML::Parser beaks at: Request message:
    Message 1 of 1 , Aug 13, 2002
    • 0 Attachment
      I've been using SOAP::Lite to talk to the amazon.com
      web services. But this envelop returns some XML that
      XML::Parser beaks at:

      Request message:
      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope
      xmlns:namesp2="http://namespaces.soaplite.com/perl"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body>
      <namesp1:SimilaritySearchRequest
      xmlns:namesp1="urn:PI/DevCentral/SoapService">
      <SimilaritySearchRequest xsi:type="namesp2:SimilarityRequest">
      <asin xsi:type="xsd:string">B000002NAV</asin>
      <mode xsi:type="xsd:string">music</mode>
      <tag xsi:type="xsd:string">webservices-20</tag>
      <type xsi:type="xsd:string">lite</type>
      <devtag xsi:type="xsd:string">**************</devtag>
      <version xsi:type="xsd:string">1.0</version>
      </SimilaritySearchRequest>
      </namesp1:SimilaritySearchRequest>
      </SOAP-ENV:Body></SOAP-ENV:Envelope>

      Response:
      <?xml version="1.0" encoding="UTF-8"?>
      ...
      <ProductName>Together at the Bluebird Café</ProductName>
      ...
      <ProductName>El Corazón</ProductName>


      Is there something I can do with SOAP::Lite to
      tell it to treat the returned XML as ISO-8859-1?
      This is obviously an amazon.com error, but I haven't
      heard from them yet. And it seems like a pretty
      fundamental error. I haven't experimented with what
      other parsers do with it.

      I think I'm running XML::Parser 2.27 (machine's at
      work, I'm at home, and I only have ssh).

      Thanks,
      Eric
    Your message has been successfully submitted and would be delivered to recipients shortly.