AJAX Forums

AJAX utf-8 encoding problem

This is a discussion on AJAX utf-8 encoding problem within the AJAX Help forums, part of the Beginners AJAX category; The following code using AJAX POST causes some Chinese characters to turn into question marks. The same string submitted in a regular form with accept-charset=utf-8 works without ...


Go Back   AJAX Forums > Beginners AJAX > AJAX Help

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Old 07-11-2007, 01:44 AM   #1 (permalink)
Junior Member
 
Join Date: Jul 2007
Posts: 1
Rep Power: 0 danielle is on a distinguished road
AJAX utf-8 encoding problem

The following code using AJAX POST causes some Chinese characters to turn into question marks. The same string submitted in a regular form with accept-charset=utf-8 works without any problem.

I googled around and couldn't find a solution. Any suggestion on how to tackle this problem would be greatly appreciated.

xmlHttp.open('POST', url, true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", postString.length);
xmlHttp.setRequestHeader("Accept-Charset","UTF-8");
xmlHttp.setRequestHeader("Connection", "close");

xmlHttp.send(postString);
danielle is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Is it possible to Remove all CSS Elements and Encoding from a Page using Elliot N XHTML and CSS 1 06-23-2007 11:39 AM
javascript problem? antheia JavaScript 3 05-15-2007 06:43 AM
Ever see this javaScript problem? Trance K JavaScript 1 04-02-2007 11:52 PM
Can someone tell me if there is a problem... timoothy36 JavaScript 0 03-19-2007 03:35 PM
Encoding problem in Ajax!? g_boss5 AJAX Errors 1 03-17-2007 11:38 AM


All times are GMT -4. The time now is 09:01 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5
Copyright ©2006 - 2008, AJAXwith.com