Home > Back-end >  Java program and c builder network communication transmission problem of Chinese characters in the c
Java program and c builder network communication transmission problem of Chinese characters in the c

Time:10-17

Younger brother recently in. Write a program, the client android applications written in Java, the server is the program written in c + + builder, now encounter problems as follows:
When the client to the server to send Chinese characters, can produce garbage problem, but send Numbers or English character is normal, also when the client to the server to send the file, the file content of Chinese characters is normal, but if the file name is Chinese characters will be garbled, personal feel is coding issues, specific how to do a little fuzzy, please god help me, it is best to give some corresponding key code, the younger brother be badly in need of help, thank you!!!!!!!!!!!

CodePudding user response:

Confirm whether the server send characters unicode

CodePudding user response:

Mobile terminal sends data when I put it into unicode but the server is written by c + + builder program I can't decode, printed is a bunch of gibberish,,,

CodePudding user response:

Visual transmission is utf-8, in c + + Builder end try using AnsiToUtf8 Utf8ToAnsi conversion and see the results,

CodePudding user response:

reference 1st floor sololie response:
confirm whether the server send characters unicode
phone send data when I put it into unicode but the server is written by c + + builder program I can't decode, printed is a bunch of gibberish,,,

CodePudding user response:

reference ccrun reply: 3/f
visual transmission is utf-8, in c + + Builder side try using AnsiToUtf8 Utf8ToAnsi conversion and see the results,
at the time of transfer I has become a unicode encoding in the Java end, but on the server side, that is, programs written in c + + Builder, I can't for the corresponding decoding operation, AnsiToUtf8 and Utf8ToAnsi the specific how to operate it, not really familiar with c + + builder, please can you give me a specific code, still have even if want to introduce the corresponding header file,,, thank you

CodePudding user response:

AnsiToUtf8 and Utf8ToAnsi is two functions in the system. HPP header file, the default using VCL engineering generally contains the header files automatically, so the direct use of these two functions,

CodePudding user response:

Problem has been solved themselves here, and share with you as follows: UTF8Decode method is added in the program.
  • Related