How to make restsharp to work with the right encod

2019-03-06 13:00发布

问题:

I have the same problem like this question RestSharp ignores response charset encoding.

But there is no right answer! Code like this

IRestResponse RSP = client.Execute(request);

not like this

Encoding encoding = Encoding.GetEncoding("ISO-8859-1");
var result = encoding.GetString(response.RawBytes);

It means the resetsharp must deserializ the result with right encoding. Someone can help?

回答1:

I solved this problem by myshelf

you just down the code source from github and edit the code

stemp 1: find HttpResponse.cs : stemp 2: find Http.cs , Ohm,maybe this solution is not match you,my request result like this,just edit the code like what I do ,then it will work well [enter image description here][3]