invalid byte 2 of 2-byte UTF-8 sequence

前端 未结 7 1918
萌比男神i
萌比男神i 2020-12-14 16:18

I am trying to parse an XML file with but ran into an error message invalid byte 2 of 2-byte UTF-8 sequence

7条回答
  •  旧巷少年郎
    2020-12-14 16:47

    The switching of the encoding for the input might help in this case:

    XMLEventReader eventReader =
                                inputFactory.createXMLEventReader(in, 
                                        "utf-8"
                                        //"windows-1251"
                                );
    

提交回复
热议问题