diff --git a/bits/22_xmlutils.js b/bits/22_xmlutils.js index 300cfcd..1d4d9cd 100644 --- a/bits/22_xmlutils.js +++ b/bits/22_xmlutils.js @@ -32,7 +32,8 @@ var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) var unescapexml/*:StringConv*/ = (function() { - var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; + /* 22.4.2.4 bstr (Basic String) */ + var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; return function unescapexml(text/*:string*/)/*:string*/ { var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));}); diff --git a/ods.flow.js b/ods.flow.js index 29b52e5..4d9b761 100644 --- a/ods.flow.js +++ b/ods.flow.js @@ -116,7 +116,8 @@ var rencoding = { var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) -var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; +/* 22.4.2.4 bstr (Basic String) */ +var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; function unescapexml(text){ var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));}); diff --git a/ods.js b/ods.js index 3f62c2d..0920378 100644 --- a/ods.js +++ b/ods.js @@ -114,7 +114,8 @@ var rencoding = { var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) -var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; +/* 22.4.2.4 bstr (Basic String) */ +var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; function unescapexml(text){ var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));}); diff --git a/odsbits/22_xmlutils.js b/odsbits/22_xmlutils.js index 3631d37..9a99a54 100644 --- a/odsbits/22_xmlutils.js +++ b/odsbits/22_xmlutils.js @@ -44,7 +44,8 @@ var rencoding = { var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) -var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; +/* 22.4.2.4 bstr (Basic String) */ +var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; function unescapexml(text){ var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));}); diff --git a/xlsx.flow.js b/xlsx.flow.js index b82e543..a4df63a 100644 --- a/xlsx.flow.js +++ b/xlsx.flow.js @@ -1457,7 +1457,8 @@ var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) var unescapexml/*:StringConv*/ = (function() { - var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; + /* 22.4.2.4 bstr (Basic String) */ + var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; return function unescapexml(text/*:string*/)/*:string*/ { var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));}); diff --git a/xlsx.js b/xlsx.js index d592390..54d7cf8 100644 --- a/xlsx.js +++ b/xlsx.js @@ -1415,7 +1415,8 @@ var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) var unescapexml = (function() { - var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; + /* 22.4.2.4 bstr (Basic String) */ + var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; return function unescapexml(text) { var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));});