Tuesday, January 17, 2012

PHP: AJAX json encode french characters

How to display french or other charset characters using AJAX JSON calls.

Current behaviour: text replaced by null;

Solution: Apply PHP function utf8_encode to the string (for each element in the array).

$string_array_element = utf8_encode($string_array_element);

No comments: