About the issue of Indy sending string encoding under XE10

Source: Internet
Author: User

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

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.