Answer the question
In order to leave comments, you need to log in
json_encode and cyrillic
Dear colleagues, please tell me how you deal with this:
I read about json_safe_encode - but the reverse (decode) does not work (does not show the “value”).
In general, how do you take it off?
$foo = array("key"=>"значение");
$json = json_encode($foo);
var_dump($json);
/*Результат: string(13) "{"name":null}" */
Answer the question
In order to leave comments, you need to log in
1. the Internet is full of classes for working with json in any locale, but they are 1000 times slower than the built-in function
2. no one bothers to go through the input, find all the lines (or all the lines you need) and pass them through iconv
3. yes, the only super stable option is utf-8 everywhere
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question