|Home About Us Services Clients Resources Blog Careers Orderbox™||contact us Site map links|
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"); ?>
© 2020 by Andy Sy
Want to tip via bitcoin?
(address string below for double checking)
Web Development / Rich Internet Applications (RIA) Development
|© 2003-2019 Neotitans Technologies Inc.||contact/hire us|