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!

XMLHTTP & Character Encoding UTF-8

Tags: encoding, xmlhttp
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 your free trial to view this solution
Question Stats
Zone: Web Development
Question Asked By: mafrosis
Solution Provided By: rdcpro
Participating Experts: 3
Solution Grade: B
Views: 252
Translate:
Loading Advertisement...
11.09.2005 at 07:58AM PST, ID: 15257144

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.09.2005 at 08:53AM PST, ID: 15257795

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.09.2005 at 11:13AM PST, ID: 15259049

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.09.2005 at 12:05PM PST, ID: 15259715

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.09.2005 at 01:03PM PST, ID: 15260416

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.10.2005 at 06:51AM PST, ID: 15265665

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29