Answer the question
In order to leave comments, you need to log in
JSON file from facebook, how to display russian text?
I exported a file with posts from the FB community in JSON format. Instead of displaying Russian texts there
\u00d0\u00a4\u00d0\u00be\u00d1\u0082\u00d0\u00be \u00d0\u00b8\u00d0\u00b7 \u00d1\u0085\u00d1\u0080\u00d0\u00be\u00d0\u00bd\u000b u00d0\u00ba\u00d0\u00b8.
On stackoverflow , I found a way to convert to readable data using PHP:
$json = changeCharset(json_decode($str, TRUE));
var_dump($json);
function changeCharset( $array ){
array_walk_recursive( $array, function(&$item) {
$item = iconv("UTF-8", "ISO-8859-1", $item);
});
return $array;
}
Answer the question
In order to leave comments, you need to log in
Try to use the JSON_UNESCAPED_UNICODE parameter when you get your json file
Here is the whole line:
$json = json_encode($return_info, JSON_UNESCAPED_UNICODE);
I used to have this problem myself. Decided just like that.
$json = utf8_encode($str);
$results = json_decode($json, TRUE);
var_dump($json);
$json = json_decode(json_encode($str, JSON_UNESCAPED_UNICODE), TRUE);
var_dump($json);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question