解析XML报错:
UTFDataFormatException: invalid byte 2 of 2-byte UTF-8 sequence (0xfa)
解决方案:
将
SAXReader reader = new SAXReader();
org.dom4j.Document document = reader.read(new ByteArrayInputStream(s.getBytes());
改成:
SAXReader reader = new SAXReader();
org.dom4j.Document document = reader.read(new ByteArrayInputStream(s.getBytes("UTF-8")));