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

Closed
consense opened this Issue Sep 1, 2013 · 2 comments

Projects

None yet

2 participants

@consense

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: '

see http://www.multiasking.com/blog/xml2js-sax-js-non-whitespace-before-first-tag/

@Leonidas-from-XIV

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.

@Leonidas-from-XIV

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