Solve the garbled problem after porting C code written by EclipseCDT to AIX in Ubuntu

Source: Internet
Author: User
Scenario: the compiler is not clear in AIX. The environment and makefile have been tossing for several days, and the Code has not been written several lines. Simply develop the Ubuntu Development Environment: ociinstant + EclipseCDT + gsoap2.7.9l + markup is to use gsoap to develop the server, accept client requests, and then parse request parameters. Request Parameters are strings in xml format. Use markup for parsing. The Data Group package found based on the request parameter database

Scenario: the compiler is not clear in AIX. The environment and makefile have been tossing for several days, and the Code has not been written several lines. Simple development on Ubuntu

Development Environment in Ubuntu: oci instant + Eclipse CDT + gsoap 2.7.9l + markup

It is to use gsoap to develop the server, accept client requests, and then parse request parameters. Request Parameters are strings in xml format. Use markup for parsing. Based on the request parameter database, the Retrieved Data Group is a string in xml format, which is sent as a response.

Problem: After the development is complete, put the code under AIX. Chinese Printing is garbled !!!

Analysis: Eclipse automatically compiled files into UTF-8 format. This is also true for Chinese characters. However, the current character set on the AIX server is not for the UTF-8. It may be GB2312 or GB18030.

It should be the GBXX character set that cannot be displayed on the UTF-8. The system cannot adapt to my programs, so all files must be transcoded. Unfortunately, some Ubuntu source code is obtained from windows. It is garbled.

Practice: Do it in a stupid way: Use the UE on the server to open a Chinese garbled file, and find the same source code file in windows that is not garbled (if not, I will take a break ), copy is not a garbled file. Then use UE to convert the UTF-8 to ASII code. Then convert it to UNIX. Then upload. One by one. All are uploaded over FTP. Re-compiled. Run, OK. All are in Chinese.

Guess: it may be that the default GBXXX Character Set of the server provides better support for the Chinese characters of the c/c ++ file in the ASII code encoding format.

Related Article

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.