UTF-8 encoding in Volley Requests

后端 未结 8 1497
天命终不由人
天命终不由人 2020-12-06 02:17

In my Android app I am loading json data with a Volley JsonArrayRequest. The data were created by myself and I saved them with Sublime with UTF-8 encoding. When

8条回答
  •  北海茫月
    2020-12-06 02:29

    another approach: you can encode your whole response by this line of code.

    newStr = URLDecoder.decode(URLEncoder.encode(oldStr, "iso8859-1"),"UTF-8");
    

    I have encoded whole response string into UTF-8 as I know volley default encode method is iso8859-1

提交回复
热议问题