Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
153
rated 0 times [  159] [ 6]  / answers: 1 / hits: 15896  / 12 Years ago, fri, may 4, 2012, 12:00:00

I have a string like this
u041au043bu0443u0431 Test;



It was decoded by json_encode(), the original string was Клуб Test in russian.
when I put it to js like



alert(u041au043bu0443u0431 Test);



I get correct displaying, like on the screen. So js
in some way poperly decodes it to normal view.
The question is how can I do the same thing in php, is there any built in method?



enter





THE ANSWER IS:
$json_in = '{testKey:u041au043bu0443u0431 Test}';
$json_out = json_decode($json_in, true);
or
Convert u041au043bu0443u0431 to Клуб
and perform html_entity_decode($str, null, 'UTF-8');


More From » php

 Answers
20

You probably want HTML entities to print the characters:




  • Ӓ for decimal code

  • Ī for hex code


[#85794] Thursday, May 3, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
melinal

Total Points: 367
Total Questions: 101
Total Answers: 96

Location: Nauru
Member since Thu, Feb 2, 2023
1 Year ago
;