SAXParser fails when responce contains Hindi or other special characters

前端 未结 5 718
遥遥无期
遥遥无期 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:49

    This should solve the problem:

    InputSource inputSource = new InputSource(is);
    inputSource.setEncoding("ISO-8859-1");
    

提交回复
热议问题