Home > Net >  C # to invoke the Web service returns data noise problem in Chinese
C # to invoke the Web service returns data noise problem in Chinese

Time:11-21

In c # to add a web service, can call the method to get the corresponding data, but the Chinese have become a question mark,



In c # to invoke the web service is two code is ok, so where is the setting what encoding format to ensure Chinese not disorderly? Ah,

CodePudding user response:

String s=Encoding Utf8. Get string ()
String s=Encoding. Unicode. Get string ()
What is the returned string coding format is web server Settings, understand what it is coding format, on translating it in a bit

CodePudding user response:

Right! You can try to debug and then upstairs brother this encoding decoding method output value you want

CodePudding user response:

In data transmission in the computer are not words, no Chinese or English, is binary data, ASCII code has a built-in default in most languages so English can be automatically decoding, advised to look at the code decoding knowledge and confirm the constraints, the service side should be how to return the data for the client to decode,
  •  Tags:  
  • C#
  • Related