Answer the question
In order to leave comments, you need to log in
How to translate json text u0418u0432u * into Russian letters?
Hello!
I take data from the database, output it, everything would be fine, but any Russian word is displayed as u0418
. I dug through a bunch of forums, but did not get a positive result.
Tried using the following decoding option:
$customerArray = json_decode($query['customer'], true);
print_r($customerArray['customer_name']); // u0418u0432u0430u043du044bu0447
Answer the question
In order to leave comments, you need to log in
php.net/manual/ru/json.constants.php
JSON_UNESCAPED_UNICODE
This is UTF 8 encoding, look in the connection settings to the database in what format the file is on the server, well, and so on.
As Vlad Malinichev said , you need the JSON_UNESCAPED_UNICODE flag.
Besides it, there are a few more useful ones:
json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question