Dealing with Byte-Order-Mark from WIndows generated XML files #99

consense opened this Issue Sep 1, 2013 · 2 comments


None yet

2 participants


Microsoft Windows may add a Byte-Oder-Mark character to the start of XML files. When encountering such a byte-chain xml2js breaks with error message

'error parsing xml: Error: Non-whitespace before first tag.\nLine: 0\nColumn: 1\nChar: '



Thanks for filing that issue. I need to think a bit about the different types of BOM (the incorrect UTF-8 one, and UTF-16BE and UTF-16LE) and how to strip them away at best.


Can you test if this works for you? I might even add a maintenance release, because this issue seems to be bugging so many peaople, according to the blog post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment