Skip to main content
Participant
January 28, 2014
Question

Unexpected behavior in xmlparse, work-around found

  • January 28, 2014
  • 0 replies
  • 307 views

If you read an XML file from another site like this:

<cfset myDoc=XMLParse("http://72.250.245.94/videoshare")>

<cfdump var = "#myDoc#">

the UTF-8 coding won't be handled correctly, and you will have unexpected characters when you display the XML data.

If you read the XML file like this:

<cfhttp

    url = "http://72.250.245.94/videoshare"

    charset = "UTF-8"

    result = "rawdoc">

   

<cfset myDoc=XMLParse(#rawDoc.filecontent#)>

<cfdump var = "#myDoc#">

The data will display as expected.

This topic has been closed for replies.