diff --git a/source/lib/workbook/builder.js b/source/lib/workbook/builder.js index 8f03efd..35e2dec 100644 --- a/source/lib/workbook/builder.js +++ b/source/lib/workbook/builder.js @@ -12,7 +12,8 @@ let addRootContentTypesXML = (promiseObj) => { { 'version': '1.0', 'encoding': 'UTF-8', - 'standalone': true + 'standalone': true, + 'allowSurrogateChars': true } ) .att('xmlns', 'http://schemas.openxmlformats.org/package/2006/content-types'); @@ -264,7 +265,8 @@ let addSharedStringsXML = (promiseObj) => { { 'version': '1.0', 'encoding': 'UTF-8', - 'standalone': true + 'standalone': true, + 'allowSurrogateChars': true } ) .att('count', promiseObj.wb.sharedStrings.length) @@ -355,7 +357,8 @@ let addStylesXML = (promiseObj) => { { 'version': '1.0', 'encoding': 'UTF-8', - 'standalone': true + 'standalone': true, + 'allowSurrogateChars': true } ) .att('mc:Ignorable', 'x14ac') diff --git a/source/lib/worksheet/builder.js b/source/lib/worksheet/builder.js index e769e8c..8698bd2 100644 --- a/source/lib/worksheet/builder.js +++ b/source/lib/worksheet/builder.js @@ -456,9 +456,12 @@ let sheetXML = (ws) => { let xmlProlog = ''; let xmlString = ''; - let wsXML = xml.begin((chunk) => { + let wsXML = xml.begin({ + allowSurrogateChars: true, + }, (chunk) => { xmlString += chunk; }) + .ele('worksheet') .att('mc:Ignorable', 'x14ac') .att('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main') @@ -517,7 +520,8 @@ let relsXML = (ws) => { { 'version': '1.0', 'encoding': 'UTF-8', - 'standalone': true + 'standalone': true, + 'allowSurrogateChars': true } ); relXML.att('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');