Half of a Chinese character string is gbk, and the other half is utf8. correct display at the same time. Solution
Source: Internet
Author: User
The other half of a Chinese character string is gbk, and the other half is utf8. why is it correctly displayed ?, You have an interesting question. why don't you say "too many"? at least there is no suitable method for such garbled code, unless the encoding rules of gbk are different from those of utf8, you cannot determine whether a Chinese character string of gb is half of gbk and the other half is utf8.
Example:
How many shopping malls does Carrefour have?
------ Solution --------------------
You have an interesting question. why don't you say "too many,
At least there is no suitable method for this garbled text. Unless the gbk encoding rules are completely different from the utf8 encoding rules, you cannot determine whether it is gbk encoding or utf8 encoding?
If the encoding is in gbk 0xffffffff and utf8 is 0xffffffff000000, you can clearly distinguish this situation, but in addition, because gbk and utf8 have many different content but the encoding is the same, the problem you mentioned above is very difficult to solve!
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.