diff --git a/lib/node-xml.js b/lib/node-xml.js index 180a482..74c3a98 100755 --- a/lib/node-xml.js +++ b/lib/node-xml.js @@ -25,6 +25,11 @@ var XMLP = function(strXML) { strXML = SAXStrings.replace(strXML, null, null, "\r\n", "\n"); strXML = SAXStrings.replace(strXML, null, null, "\r", "\n"); + // if encoded as utf-8, the first few bytes are interpreted as a space, so remove it + if (strXML.charAt(0) == '') { + strXML = strXML.substring(1); + } + this.m_xml = strXML; this.m_iP = 0; this.m_iState = XMLP._STATE_PROLOG;