Half of a Chinese character string is gbk, and the other half is utf8. why is it correctly displayed? ------ Solution ------------------ you have an interesting question. why don't you say "too many"? how can this problem be clearly understood? at least there is no proper method for such garbled code at present, unless the gbk encoding rules are completely different from the utf8 encoding rules, you cannot determine whether the encoding is gbk or utf8? If half of a Chinese character string in gbk is in gbk and the other half is in utf8, it will be correctly displayed at the same time.
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!