commit 06615f738f96149a2d9a9429d90cf0928009cf5a
parent b9fb7fa3c6cbb5d917bcb26998efd23fd4a93364
Author: Simon Kornblith <simon@simonster.com>
Date: Wed, 14 Jan 2015 01:55:32 -0500
Tweak method for parsing XML without a window to handle UTF-8 properly
Fixes issue reported at https://forums.zotero.org/discussion/45556
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js
@@ -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;