Reputation: 6645
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.
Upvotes: 0
Views: 924
Reputation: 20067
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.
Upvotes: 1