How to make restsharp to work with the right encoding for response?

喜欢而已 提交于 2019-12-04 06:22:34

问题


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]



来源:https://stackoverflow.com/questions/45788630/how-to-make-restsharp-to-work-with-the-right-encoding-for-response

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!