Tweak method for parsing XML without a window to handle UTF-8 properly
Fixes issue reported at https://forums.zotero.org/discussion/45556
This commit is contained in:
parent
b9fb7fa3c6
commit
06615f738f
1 changed files with 1 additions and 1 deletions
|
@ -404,7 +404,7 @@ Zotero.Translate.SandboxManager = function(sandboxLocation) {
|
|||
this.__exposedProps__ = {"parseFromString":"r"};
|
||||
this.parseFromString = function(str, contentType) {
|
||||
var xhr = sandbox.XMLHttpRequest();
|
||||
xhr.open("GET", "data:"+contentType+";base64,"+btoa(str), false);
|
||||
xhr.open("GET", "data:"+contentType+";charset=utf-8,"+encodeURIComponent(str), false);
|
||||
xhr.send();
|
||||
if (!xhr.responseXML) throw new Error("error parsing XML");
|
||||
return xhr.responseXML;
|
||||
|
|
Loading…
Add table
Reference in a new issue