php displays unicode escaped characters
The problem is age old: php + mysql + utf-8 encoding
We have a two component model: a backend service, that provides access to some json data via web-access and some client, that displays the data. the backend reads data from a mysql source, which is of collation type 'utf8 - default collation', the php script is utf-8 encoded.
The problem is that the rendered json data contains escaped unicode characters like 'Rungestra\u00dfe 20'. what could be done to see the 'real' entity like 'ß' in this case?
The problem is that the rendered json data contains escaped unicode characters like 'Rungestra\u00dfe 20'
Why is that a problem? \u00DF is perfectly valid JSON syntax for the letter ß. Any JSON decoder will parse that string literal escape into the single character U+00DF Latin Small Letter Sharp S. For example if your client is a web browser then JSON.parse().
ß can be included in an HTML document as-is, you do not have to escape it to ß or ß.
Found this by google should help here. http://stackoverflow.com/a/2577882/2422553
Try mb_convert_encoding() with the "to" encoding as 'HTML-ENTITIES', and (if necessary) the "from" encoding set to 'UTF-8' or whichever Unicode encoding you're using.