-
UTF-8 Characters in AJAX Response
**************** Apologies if you had run into this post at other Ajax forums *******************
Hi,
I've UTF-8 characters in the response string of XMLHttp request, below is how I see the response in the client browser(Firefox) :
1) Firebug - <name>Cardenas " © ®. </name>
2) Javascript alert - <name>Cardenas " � �. </name>
Question is why Javascript is failing to read the UTF-8 characters correctly? Thanks
-
Resolved
The problem was in the way we were writing the AJAX response on the server side, the code below fixed it :
PrintWriter writer = new PrintWriter(newOutputStreamWriter(response.getOutputStream(), "UTF8"), true);
response.setContentType("text/xml; charset=UTF-8");
Similar Threads
-
By guerai78 in forum AJAX
Replies: 5
Last Post: 07-14-2008, 01:34 PM
-
By waterbomm in forum AJAX
Replies: 0
Last Post: 10-05-2007, 02:11 AM
-
Replies: 0
Last Post: 06-18-2007, 11:06 AM
-
By Java_Maniac in forum AJAX
Replies: 1
Last Post: 12-29-2006, 06:29 AM
-
Replies: 0
Last Post: 02-09-2006, 02:26 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|