【exceptions】Invalid byte 3 of 3-byte UTF-8 sequence

I found this error when debugging the interface. The two sides of the interface said that the encoding method is UTF-8, but when I send the xml, the other party's system has this error. This error is because the xml contains Chinese information. Encoding format error in Chinese

The original xml format is UTF-8

<?xml version="1.0" encoding='UTF-8'?>
<aaa>
...
</aaa>

After modification to GBK, the program is normal

<?xml version="1.0" encoding='gbk'?>
<aaa>
...
</aaa>

Now I only know that this modification method is feasible, but the specific reason is still unclear. If anyone knows, please let me know, thank you

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325747196&siteId=291194637