Open michaelkirk opened 3 years ago
Maybe a dupe of https://github.com/netvl/xml-rs/issues/155
So it seems that this is a known issue - xml_rs explodes when encountering a BOM.
The author prefers that, since the BOM exists "outside of the xml", this should be fixed by every user of the crate, to be sure any BOM is stripped before handing input to the xml_rs crate.
Their suggestion is to build something like:
use bom_remover::BomRemover;
let file = File::open("file.xml").unwrap();
let file = BufReader::new(file):
let file = BomRemover::new(file);
let reader = EventReader::new(file);
e.g. the default overpass-turbo script:
You'll get a file like this (though unzipped): overpass-export-bom.osm.gz
When I try to process it, the osmio parser explodes with:
If I open in vim, run
:set nobomb
and save it as: overpass-export-nobom.osm.gz, then osmio can successfully process the input.