Advertisement

11.09.2005 at 06:13AM PST, ID: 21624718
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

XMLHTTP & Character Encoding UTF-8

Asked by mafrosis in Extensible Markup Language (XML)

Tags: ,

Hello all, ive been having strange problems using XMTHTTP to send XML messages to a server and back.  I have a page encoded in UTF-8:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

And my XML messages are UTF-8 encoded:
<?xml version="1.0" encoding="UTF-8"?><ajax-request><addmsg><![CDATA[ £ ]]></addmsg></ajax-request>

Im using the prototype library for managing the XMLHTTP requests, so in Firefox the object im using is this one:
new XMLHttpRequest()

My problem is that when I send a message with a pound sign (£ - unicode 163) which is outside the usual iso-8859-1 set, it becomes encoded as this:
£

Is there a provision in the XMLHTTP object to specify character encoding?  I cant seem to find one.  It would appear the only available choice is iso-8859-1.  You can see this encoding problem in action by doing this browser test.  Create an XML file with this content:

<?xml version="1.0" encoding="UTF-8"?><ajax-request><addmsg><![CDATA[ £ ]]></addmsg></ajax-request>

View it in a browser and then change the encoding to "iso-8859-1"; refreshing the page shows the behaviour I am experiencing in my XMLHTTP requests.

Conversely, if i create a static HTML page with a content-type encoding set to UTF-8 and then include the pound sign (£) from my keyboard, the browser renders it as this character: &#65533; - switching the encoding to iso-8859-1 renders a correct pound sign (£)!  Not quite sure what this means...

So to clarify, can anyone explain what exactly is going on here?  And how can I deal with the XMLHTTP encoding problem?

Thanks for your help Start Free Trial
[+][-]11.09.2005 at 07:58AM PST, ID: 15257144

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 08:53AM PST, ID: 15257795

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 11:13AM PST, ID: 15259049

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 12:05PM PST, ID: 15259715

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 01:03PM PST, ID: 15260416

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Extensible Markup Language (XML)
Tags: encoding, xmlhttp
Sign Up Now!
Solution Provided By: rdcpro
Participating Experts: 3
Solution Grade: B
 
 
[+][-]11.10.2005 at 06:51AM PST, ID: 15265665

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32