In PHP, if you JSON-encode a string that contains accented characters, the result contains unicode sequences (for example: \u00e9 represents the é character).

<?php
$string = 'åbcdéfg';
print json_encode($string) . "\n";
?>

Running this gives the following output:

"\u005e5bcd\u00e9fg"

If you want to replace the unicode sequences back to their character representation, here’s what you need:

function jsonRemoveUnicodeSequences($struct) {
   return preg_replace("/\\\\u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", json_encode($struct));
}

Example:

<?php
$string = 'åbcdéfg';
print jsonRemoveUnicodeSequences($string) . "\n";
?>

Results in:

"åbcdéfg"