2016-10-18 40 views
-1

我有一個寧靜 swagger API。如何解決亂碼字符中國(GB2312如何修復亂碼的中文?

server.ServiceModel.Customer { 
    Email: "[email protected]*foxmail*.com" 
    Login: "test01" 
    Mobile_phone: "18018187878" 
    Notes: "嫺嬭瘯" 
    Password: "123456" 
} 

請求:

Origin: http://127.0.0.1:8088 
Connection: keep-alive 
Content-Length: 92 
Content-Type: application/x-www-form-urlencoded 
Accept: application/json 
Accept-Encoding: *gzip*, deflate 
Accept-Language: zh-CN,zh;q=0.8,en;q=0.6 
Host: 127.0.0.1:8088 
Referer: http://127.0.0.1:8088/*swagger-ui*/ 
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 *Safari*/537.36 

Form

+0

你解決問題了嗎?你能解釋一下你期望的行爲有什麼不同嗎? –

回答

0

ServiceStack中的大多數編碼都是通過UTF-8編碼的。如果你想能夠使用不同的編碼,我認爲你應該放置一個功能請求。但我不知道這是否是問題。

您確定以不同的編碼方式發送您的請求,或者您是否也發送了utf-8樣式的請求嗎?

從你的問題的不知道是哪裏的問題恰恰是,但也許這個回答可以幫助你:https://stackoverflow.com/a/379929/1275832