-1

I have a restful swagger API. How do I resolve the garbled Chinese characters (GB2312)?

server.ServiceModel.Customer {
    Email: "test01@*foxmail*.com"
    Login: "test01"
    Mobile_phone: "18018187878"
    Notes: "娴嬭瘯"
    Password: "123456"
}

Request:

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

Scott
  • 21,211
  • 8
  • 65
  • 72
yujian
  • 1
  • 1

1 Answers1

0

Most encoding in ServiceStack goes through UTF-8. If you'd like to be able to use a different encoding i think you should place a feature request. But i wonder if this is the problem.

Are you sure you sending your request in a different encoding or are you also sending it utf-8 style?

From your question its not sure where the problem is precisely but maybe this answer can help you: https://stackoverflow.com/a/379929/1275832

Community
  • 1
  • 1
Joel Harkes
  • 10,975
  • 3
  • 46
  • 65