SAXParser fails when responce contains Hindi or other special characters

前端 未结 5 839
遥遥无期
遥遥无期 2021-01-21 05:57

I am using SAX parser to parse a XML response but it throws an exception.

ExpatParser$ParseException : (not well formed) invalid token

Is there any

5条回答
  •  我在风中等你
    2021-01-21 06:44

    Try with android.util.Xml.parse()
    First argument InputStream => HttpResponse.getEntity().getContent()
    Second argument Xml.Encoding => Xml.Encoding.UTF_8
    Last argument ContentHandler => your handler

提交回复
热议问题