The XML-RPC library in Delphi does not support Chinese Solutions

Source: Internet
Author: User
Tags soap client

I recently read a post on the Internet: topic: the client uses Delphi to write data, and the server uses Java to write data. Is this mode feasible?

UsersGreateWeiThe idea reminds me that xml_rpc is used for interaction between different languages. I used a Java => xml => HTTP => xml => Delphi system in a software company. I didn't use other technologies. I only used idhttp components to get XML. The only difference is that the construction process is troublesome, especially when constructing XML. Now we use XML-RPC for a component.

The implementation of the system architecture is based on the following considerations:
1. XML-RPC compared with soap: Delphi soap client has some performance problems and Java implementation of some compatibility problems, so the use of XML-RPC implementation, and XML-RPC implementation compared with SOAP implementation, performance is much better;
2. Comparison of XML-RPC with socket: using HTTP protocol can effectively penetrate different network firewalls;
3, the use of XML format to exchange data, rather than the use of XML-RPC standard format to exchange data, mainly because the XML-RPC format is relatively simple, complex data format is difficult to meet the needs, directly Using the object XML data stream is conducive to system expansion;

Today I tested Apache XML-RPC: http://ws.apache.org/xmlrpc/, with Delphi XML-RPC: http://sourceforge.net/projects/delphixml-rpc/, using Apache on the server while Delphi is used as the client. A problem found: when using the Delphi XML-RPC library, Chinese is not supported.

Through Google information, and view the source code of Delphi XML-RPC library, it is found that the XML parsing unit libxmlparser. PAS does not support Asian character set. Therefore, the idea of modifying the XML parsing unit libxmlparser. PAS was generated.

Finally, the problem is found in the following sentence:

CurContent: = CurContent + CHR (StrToIntDef ('$' + Copy (Name, 3, MaxInt), 32 ))

And CurContent: = CurContent + CHR (StrToIntDef (Copy (Name, 2, MaxInt), 32 ));

If there are multi-byte characters, there is a problem with CHR. Is to use WideChar to solve the problem.

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.