added BOM detection and subsequent parseError.