A
A
Andrew2015-12-09 14:43:15
PHP
Andrew, 2015-12-09 14:43:15

PHP json_decode cyrillic problem?

Good afternoon, there was a problem with the fact that when contacting the server, the ANSWER from it comes in json format and among them there may be Russian letters, as a result of which the standard json_decode function does not work, is it possible to fix this somehow? google didn't come up with anything clear.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrew, 2015-12-09
@15megatonn

<?php
$data_json = utf8_encode($data_json); 
$results = json_decode($data_json);

R
romy4, 2015-12-09
@romy4

encode Cyrillic with \uABCD; escape sequences. In general, php itself should do this, check the options for one thing.

X
xuxubla, 2015-12-09
@xuxubla

Most likely, you have windows-1251? Try in UTF-8.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question