WE HAVE A WINNER!!!

Christopher Lomvardias

1) As Christopher stated: "If memory serves, the MSXML component 
blindly decodes any incoming XML as UTF-8 or UTF-16."

The solution below fixed that for MSXML.

2) Stupidly enough, there was never a problem with cfhttp (CF 4.5 and 
earlier) and CFX_RawSocket. I have a place in my code where I specify 
the calloption as cfhttp, msxml or rawsocket. Then I pass the 
attribute into my custom tag with calloption="#calloption#". Like a 
freaking idiot, and I don't know how I didn't see this, I had hard 
coded calloption="msxml" into my tag (for testing) and although I was 
changing the calloption variable, I was using MSXML the whole time, 
which of course was being munged due to number 1 above.

And you know the only reason I found it? Because Christopher also 
pointed out that I should be using serverXMLHTTP in my com object. 
When I tried that, I got an error on my Win98 box that the COM object 
couldn't be created after I was done testing on the server and had 
changed the code to use serverXMLHTTP. Which I thought was curious 
since I had changed the calloption to cfhttp. LOL

ACK!!!

Anyway, thanks everyone for your help. The time I spent on this 
because of my own brain-death was ridiculous. but I still needed this 
fix for MSXML for anyone who needs to use it.

Anyway, it may be a few days, but send me your address Christopher 
and I'll get your reward off. If you'd prefer it go to a charity, 
that's cool or I can donate it to the list.

Thanks a bunch.

On 2/5/03, Lomvardias, Christopher penned:
>Bud,
>
>Here is the solution in two pieces.
>
>1. Change the last line in your cfscript block from
>XMLResponse = objXMLHTTP.responsetext;
>to
>XMLResponse = objXMLHTTP.responseXML;
>
>2. Then Add the following code immediately below the original code block you
>sent me:
>
><cfobject action="CREATE" type="COM" class="Microsoft.XMLDOM"
>name="objXMLDOM">
><cfscript>
>       objXMLDOM.LOAD(XMLResponse);
>       xml_data =
>objXMLDOM.getElementsByTagName("AccessLicenseAgreementResponse");
></cfscript>
>
><cfloop collection="#xml_data#" item="xml_node">
>       <cfset xmllicensevalue =
>xml_node.SelectSingleNode("AccessLicenseText")>
></cfloop>
><cfoutput>#xmllicensevalue.text#<cfoutput>
>
>You should find that "xmllicensevalue.text" presents the data correctly. You
>should reset that into another variable as well.
>
>Just as an FYI, this was tested successfully using MSXML 4. Essentially the
>responseXML property preserves the 8859-1 encoding whereas the responsetext
>property you were using does not.
>
>Let me know if you have any questions.
>
>
>Chris Lomvardias
>
>
>-----Original Message-----
>From: Bud
>To: CF-Talk
>Sent: 2/5/03 12:56 PM
>Subject: Character Encoding - Reward Offered!
>
>OK. $250.00 reward to the first person who can tell me what I'm doing
>wrong or give me evidence/show me how to prove that UPS is returning
>the wrong character set. Knowing UPS, I suspect it's the latter.
>
>Here is the page:
>
>http://dev.cf-ezcart.com/registerups/
>
>Click Next.
>
>The text in the top textarea field is being returned by UPS which I'm
>stripping from the XML. It is all screwed up. Most notably the French
>text at the bottom, but also trademark symbols and such.
>
>The text in the bottom textarea field is the hard-coded text they
>sent to me which I pasted in and displays properly.
>
>I'm using this at the top of the template:
><cfset setEncoding("form","iso-8859-1")>
><cfset setEncoding("URL","iso-8859-1")>
><cfcontent type="text/html; charset=iso-8859-1">
>
>This is in the HTML HEAD tag:
><meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
>
>I tried using <CFPROCESSINGDIRECTIVE pageencoding="iso-8859-1"> in
>both the template and the custom tag I'm calling but it didn't make a
>difference.
>
>CFMX server. CrystalTech.
>
>Here is the response from UPS Tech support. They are absolutely no help:
>
>***
>Thank you for your email.  Due to the many environments and ways which
>customers can implement the XML Tools, we do not support code directly
>and
>provide source code samples for reference only.  Unfortunately we can
>not
>provide you with access to a cold fusion developer, we do however
>provide Visual Basic and Java source code samples that employ the
>ISO-8859-1
>standard.  The ISO-8859-1 character-set is necessary to be able to use
>the
>special French characters and is returned by our servers please
>reference
>the header of our XML response which contains the encoding specification
>of
>ISO-8859-1.  Since the French charter-set is not being properly
>displayed in
>the web page we anticipate that your program is manipulating the
>encoding of
>the text and setting the encoding to UTF-8 or UTF-16.  Please review
>your
>programming environment.
>--
>
>Bud Schneehagen - Tropical Web Creations
>
>_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>ColdFusion Solutions / eCommerce Development
>[EMAIL PROTECTED]
>http://www.twcreations.com/
>954.721.3452
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to