
The different encoding also caused the popular XML Content is not allowed in prolog.Īnd we use a UTF-16 encoding to parse the above UTF-8 encoding XML file. P.S Many text or code editors have features to add or remove byte order mark (BOM) for a file, try find the feature in the menu.


Tested with Java 11 and Java 8, the built-in SAX parser can parse the BOM UTF-8 file correctly however, some developers claimed the BOM caused an error for XML parsing.

