Answer the question
In order to leave comments, you need to log in
Why doesn't json_decode work after iconv?
Hi friends. Please tell me why json_decode doesn't work after iconv?
The situation is this: there is a site in cp1251, there is a remote server that, via API (curl), gives JSON in utf-8. Naturally, the Cyrillic alphabet in it comes out as krakozyabry. For this I do:
$actions_converted = iconv("utf-8", "cp1251", curl_exec($ch));
$actions = json_decode($actions_converted);
$actions = json_decode(curl_exec($ch));
$actions_converted = iconv("utf-8", "cp1251", $actions);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question