Web Hosting Philippines, Offshore Programming, Offshore SEO Philippines, Cheap Webhosting Manila Philippines
Home -> Resources -> Web Development -> Foreign characters in XHR-served documents

How to get foreign characters in XHR (aka. 'AJAX')-served documents to display properly

The original page that explains the problem and solution: http://erik.eae.net/archives/2005/05/27/18.55.22/

When you serve 'AJAX' content via XHR, the document served is assumed to be encoded as UTF-8, thus foreign characters might not necessarily display correctly if that was not the original character encoding scheme used.

The solution is to figure out what the proper encoding is and tell the web server to serve it as part of the Content-Type header. In PHP, this is how you would do it:

header("Content-Type: text/html; charset=ISO-8859-1");

Back to Top

© 2021 by Andy Sy
last updated: 2006-02-01

 Want to tip via bitcoin?

(address string below for double checking)

Web Development / Rich Internet Applications (RIA) Development

Programming Languages


Database Development

   © 2003-2019 Neotitans Technologies Inc.