当ajax响应编码中的西里尔字符错误时[重复]

This question already has an answer here:

I have the fallowing Cyrillic string i want to return in my ajax response : 'Този еmail е вече регистриран'.

How ever when i do this:

<?php
    public function echoCyrllic(){
        $json['error']='Този еmail е вече регистриран';
        echo json_encode($json);
    }
 ?>

My response is this:

{"error":"\u0422\u043e\u0437\u0438 \u0435mail \u0435 \u0432\u0435\u0447\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0430\u043d"}

Can anybody help. Thanks.

</div>

this json is valid... even though it looks dirty.. the json will decode it correctly

try it out

 alert(reponse.error);

if in case you don't want as such then.. send error as text and use condition to display this where you wanted..

like

 $json['error']='error';
 echo json_encode($json);

and in javascript

if(response.error == "error"){
     alert('Този еmail е вече регистриран');
}

however, this is just another way to do it.. but i prefer to go with the first one.. since there is nothing wrong with the first one.. :)