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
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4