How can I reverse string entities that contain Chinese and Korean characters?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.