Home > Net >  Utf-8 transcoding, the string is a Json, the Chinese appear individual Chinese Json is garbled
Utf-8 transcoding, the string is a Json, the Chinese appear individual Chinese Json is garbled

Time:09-23

 WebClient wc=new WebClient (); 
Byte [] data=https://bbs.csdn.net/topics/wc.DownloadData (url);
String strBuff=Encoding. GetEncoding (" utf-8 "). Get string (data);


If switch to other coding, it is all the code, utf-8 is individual Chinese garbled, strives for the great god answer answer

CodePudding user response:

This encoding \ uxxxx?
The Regex Unescape can handle

CodePudding user response:

You visit the address of the post I have a look at this is probably the access server-side code you have any question

CodePudding user response:

reference 1/f, Eva will hit soy sauce response:
\ uxxxx this code?
Regex. Unescape can handle

Isn't this is Chinese garbled, individual

CodePudding user response:

refer to the second floor HttpCookie response:
you visit the address of the post I have a look at this it is possible that your access is a problem with the server code

Access is an interface, in taobao's details page in your browser to see the Json is normal, but I used the above is the individual garbled

CodePudding user response:

https://h5api.m.taobao.com/h5/mtop.taobao.detail.getdetail/6.0/? API=mtop. Taobao. Detail. Getdetail& data=https://bbs.csdn.net/topics/%7B%22id%22%3A%22609607141124%22%2C%22itemNumId%22%3A%22609607141124%22%2C%22itemId%22%3A%22609607141124%22%7D

Visit the download data, a few garbled

CodePudding user response:

Won't know until you look at taobao js

CodePudding user response:

That is really the code this can't deal with, each other when the input data is garbled

CodePudding user response:

refer to 6th floor 9 0 channel response:
to see taobao js to know

JS, I just download this data, has nothing to do with JS should be

CodePudding user response:

she would play the soy sauce reference 7 floor response:
that's really the code this can't deal with, each other when the input data is garbled

Not yes, direct access to the display of data is not garbled, I download, use utf-8 decoding, an individual gibberish, error result in json

CodePudding user response:

references 9 f Little_Code response:
Quote: she can play the soy sauce reference 7 floor response:

That is really the code this can't deal with, each other when the input data is garbled

Not yes, direct access to the display of data is not garbled, I download, use utf-8 decoding, encourage individual gibberish, json error

You share above I didn't see the code, download this connection do you use?

CodePudding user response:

refer to the eighth floor Little_Code response:
Quote: refer to the sixth floor 9 0 channel response:

Won't know until you look at taobao js

JS, I just download this data, has nothing to do with JS should the

Is there this kind of situation, the json returned to the browser, through taobao js is not shown in the code

CodePudding user response:

Get the data first, and then replace some characters such as \ "replace", in to utf-8 decoding
May be due to a special character

CodePudding user response:

You first need to ensure the source string is normal

CodePudding user response:

The
big watermelon a WuYiJin reference 10 floor? Response:
Quote: references 9 f Little_Code response:

Quote: she can play the soy sauce reference 7 floor response:

That is really the code this can't deal with, each other when the input data is garbled

Not yes, direct access to the display of data is not garbled, I download, use utf-8 decoding, encourage individual gibberish, json error

You share above I didn't see the code, download this connection do you use?

How do you download, using the WebClient? Look at the code, and results

CodePudding user response:

The
my friend refer to 12 floor guest response:
get the data first, and then will replace some characters such as \ "replace", in to utf-8 decoding
May be due to a special characters of


11 references 9 0 channel response:
Quote: refer to the eighth floor Little_Code response:

Quote: refer to the sixth floor 9 0 channel response:

Won't know until you look at taobao js

JS, I just download this data, has nothing to do with JS should the

Have this kind of circumstance, the json returned to the browser, through taobao js is not displayed in the code

The purpose is to solve the problem of not garbled, direct access to the browser will not gibberish, download is garbled, the key is to deal with this problem, what other js, no matter

CodePudding user response:

On the 14th floor Little_Code
reference response:
Quote: reference to the tenth floor big watermelon a WuYiJin? Response:

Quote: references 9 floor Little_Code response:

Quote: she can play the soy sauce reference 7 floor response:

That is really the code this can't deal with, each other when the input data is garbled

Not yes, direct access to the display of data is not garbled, I download, use utf-8 decoding, encourage individual gibberish, json error

You share above I didn't see the code, download this connection do you use?

How do you download, using the WebClient? Look at the code, and the results

Is your
 
The string url="https://h5api.m.taobao.com/h5/mtop.taobao.detail.getdetail/6.0/? API=mtop. Taobao. Detail. Getdetail& nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • C #
  • Related