How can I reverse the string entity that contains Chinese and Korean characters ??? I have a string in which Chinese characters are normal, but Korean is an entity escape. I used: $ strhtml_entity_decode ($ contents, ENT_QUOTES, UTF-8); this way I can convert Korean to a character, but it also converts Chinese... So garbled characters appear. Is there any good way to switch to Korean ??? Thank you! ------ Solution -- how can I reverse string entities that contain Chinese and Korean characters ???
I have a string in which Chinese characters are normal, but Korean is an entity escape.
My use:
$ Str = html_entity_decode ($ contents, ENT_QUOTES, 'utf-8 ');
In this way, the Korean can be converted into characters, but the Chinese can also be converted... So garbled characters appear.
Is there any good way to switch to Korean ???
Thank you!
------ Solution --------------------
How can non-ASCII characters encoded by utf8 be confused with unescaped entity characters?
No way.
------ Solution --------------------
1. confirm that your $ content is UTF-8 encoded. you can explain how to obtain the content.
2. call the browser meta to tell it to parse according to utf8.
------ Solution --------------------
Header ("content-type: text/html; charset = utf-8"); // add this sentence
------ Solution --------------------
Where did you see Chinese garbled characters? Encoding inconsistency.
------ Solution --------------------
Then you should check what code turns Korean into an entity.
------ Solution --------------------
I don't know how your Korean is entered.
If your Korean language is not input through the Chinese input method, it must conflict with the Chinese language.