why org.apache.xerces.parsers.SAXParser does not skip BOM in utf8 encoded xml?

前端 未结 3 566
南方客
南方客 2020-12-07 01:54

I have an xml with utf8 encoding. And this file contains BOM a beginning of the file. So during parsing I am facing with org.xml.sax.SAXParseException: Content is not allowe

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-07 02:42

    This has come up before, and I found the answer on Stack Overflow when it happened to me. The linked answer uses a PushbackInputStream to test for the BOM.

提交回复
热议问题