aalto-xml
aalto-xml copied to clipboard
getLocation() doesn't count xml prolog for non-utf8 documents
Calling XMLStreamReader.getLocation().getCharacterOffset() works ok for utf-8 xml files.
But when file is for instance in iso-8859-2 encoding returned value is less by length of "" prolog.
I guess that ReaderScanner created in ByteSourceBootstrapper.doBootstrap is not given current position. And thus length of prolog is not taken into account.
demo here: https://github.com/anomen-s/programming-challenges/commit/4c9d1a6b6db0ed025a057b63fdeec0e9fa890640