From 06615f738f96149a2d9a9429d90cf0928009cf5a Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 14 Jan 2015 01:55:32 -0500 Subject: [PATCH] Tweak method for parsing XML without a window to handle UTF-8 properly Fixes issue reported at https://forums.zotero.org/discussion/45556 --- chrome/content/zotero/xpcom/translation/translate_firefox.js | 2 +- 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 index 4d72338481..ea46d2f3b7 100644 --- 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;