The byte order mark is the first 3 bytes in my xml file. How do I remove the Byte order mark from the xml file programmatically? I want to completely discard it.
Asked
Active
Viewed 905 times
1 Answers
1
Rather than removing it, I use a special reader which reacts properly to BOM (and uses proper encoding, based on read BOM): I copied it from elsewhere (see note inside) but it is open-sourced in my android-menu-navigator project:
You can use this reader anyway to read content of XML and write it elsewhere, effectively removing the BOM.

Jarek Potiuk
- 19,317
- 2
- 60
- 61