From 6d5b2c3d12d028c03f34dfa2f95fd79389596b54 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 5 Jul 2020 18:07:04 -0400 Subject: [PATCH] =?UTF-8?q?Fx-compat:=20`nsIUTF8ConverterService`=20?= =?UTF-8?q?=E2=86=92=20`nsIScriptableUnicodeConverter`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not totally clear what this does or if it's necessary (see #1540), but this is a replacement that Thunderbird used. --- chrome/content/zotero/xpcom/fulltext.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js index 5b8b37b228..63f8a5df57 100644 --- a/chrome/content/zotero/xpcom/fulltext.js +++ b/chrome/content/zotero/xpcom/fulltext.js @@ -67,8 +67,8 @@ Zotero.Fulltext = Zotero.FullText = new function(){ yield Zotero.DB.queryAsync("ATTACH ':memory:' AS 'indexing'"); yield Zotero.DB.queryAsync('CREATE TABLE indexing.fulltextWords (word NOT NULL)'); - this.decoder = Components.classes["@mozilla.org/intl/utf8converterservice;1"]. - getService(Components.interfaces.nsIUTF8ConverterService); + this.unicodeConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] + .createInstance(Ci.nsIScriptableUnicodeConverter); let pdfConverterFileName = "pdftotext"; let pdfInfoFileName = "pdfinfo"; @@ -1675,7 +1675,8 @@ Zotero.Fulltext = Zotero.FullText = new function(){ try { if (charset && charset != 'utf-8') { - text = this.decoder.convertStringToUTF8(text, charset, true); + this.converter.charset = charset; + text = this.converter.ConvertToUnicode(text); } } catch (err) { Zotero.debug("Error converting from charset " + charset, 1);