In the process of docking with the hardware, before using the D7 environment Udpserver.post sent instructions, the hardware can be recognized and normal display,
Later use to XE10, recompile before the source code, found that all Chinese characters garbled display;
After the reception of the data found that the actual transmission of the code is abnormal, and the English and the numbers are normal, the Chinese character display is not normal,
The only thing that could be a character coding problem.
The default string data type is sent in the D7 environment
XE10 is also sent under the same string type,
To solve the garbled problem, the processing method is in the XE10 environment, Udpserver.post, pay attention to set the instruction code sent
Regular Send As: Udpserver.post (Ip,port,data);
Under Xe10, add the encoding format: Udpserver.post (Ip,port,data, indytextencoding (Tencoding.ansi));
A total of 7 formats are available under XE10: (The instruction code sent by the test default is the same as ANSI)
Indytextencoding (Tencoding.ansi)
Indytextencoding (TENCODING.ASCII)
Indytextencoding (Tencoding.bigendianunicode)
Indytextencoding (Tencoding.default)
Indytextencoding (Tencoding.unicode)
Indytextencoding (TENCODING.UTF7)
Indytextencoding (Tencoding.utf8)
About the issue of Indy sending string encoding under XE10