diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js index bc4ab3922a..d4c03fed30 100644 --- a/chrome/content/zotero/fileInterface.js +++ b/chrome/content/zotero/fileInterface.js @@ -279,8 +279,8 @@ var Zotero_File_Interface = new function() { let str = Components.classes['@mozilla.org/supports-string;1'] .createInstance(Components.interfaces.nsISupportsString); str.data = text; - transferable.addDataFlavor('text/unicode'); - transferable.setTransferData('text/unicode', str, text.length * 2); + transferable.addDataFlavor('text/plain'); + transferable.setTransferData('text/plain', str, text.length * 2); // Add HTML str = Components.classes['@mozilla.org/supports-string;1'] @@ -502,7 +502,7 @@ var Zotero_File_Interface = new function() { * Imports from clipboard */ this.importFromClipboard = Zotero.Promise.coroutine(function* () { - var str = Zotero.Utilities.Internal.getClipboard("text/unicode"); + var str = Zotero.Utilities.Internal.getClipboard("text/plain"); if(!str) { var ps = Services.prompt; ps.alert( @@ -823,8 +823,8 @@ var Zotero_File_Interface = new function() { var str = Components.classes["@mozilla.org/supports-string;1"]. createInstance(Components.interfaces.nsISupportsString); str.data = output; - transferable.addDataFlavor("text/unicode"); - transferable.setTransferData("text/unicode", str, output.length * 2); + transferable.addDataFlavor("text/plain"); + transferable.setTransferData("text/plain", str, output.length * 2); clipboardService.setData(transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard); diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index 4946ebe7cb..dbe78cd2cd 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -2101,7 +2101,7 @@ var Zotero_QuickFormat = new function () { event.stopPropagation(); event.preventDefault(); - var str = Zotero.Utilities.Internal.getClipboard("text/unicode"); + var str = Zotero.Utilities.Internal.getClipboard("text/plain"); if (str) { isPaste = true; this.value += str.replace(/[\r\n]/g, " ").trim(); diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index 5833c771eb..099bec6d62 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -2354,7 +2354,7 @@ Zotero.Utilities.Internal = { let targetInput = targetInputWeak.deref(); if (!targetInput) return; targetInput.focus(); - targetInput.value = Zotero.Utilities.Internal.getClipboard('text/unicode') || ''; + targetInput.value = Zotero.Utilities.Internal.getClipboard('text/plain') || ''; targetInput.dispatchEvent(new Event('input')); }); editMenuItems.push(pasteMenuitem); diff --git a/test/tests/fileInterfaceTest.js b/test/tests/fileInterfaceTest.js index dd28614b0d..bbe7650293 100644 --- a/test/tests/fileInterfaceTest.js +++ b/test/tests/fileInterfaceTest.js @@ -156,7 +156,7 @@ describe("Zotero_File_Interface", function() { assert.equal(str, '(A, 2016; B, 2016)'); // Plain text - str = getDataForFlavor('text/unicode'); + str = getDataForFlavor('text/plain'); assert.equal(str, '(A, 2016; B, 2016)'); }); @@ -173,7 +173,7 @@ describe("Zotero_File_Interface", function() { assert.include(str, 'B'); // Plain text - str = getDataForFlavor('text/unicode'); + str = getDataForFlavor('text/plain'); assert.equal(str, 'A. (2016).\nB. (2016).\n'); }); @@ -193,7 +193,7 @@ describe("Zotero_File_Interface", function() { assert.equal(str, '(A, 2016; B, 2016)'); // Plain text - str = getDataForFlavor('text/unicode'); + str = getDataForFlavor('text/plain'); assert.equal(str, '(A, 2016; B, 2016)'); }); @@ -211,7 +211,7 @@ describe("Zotero_File_Interface", function() { assert.include(str, 'B'); // Plain text - str = getDataForFlavor('text/unicode'); + str = getDataForFlavor('text/plain'); assert.include(str, 'line-height'); assert.include(str, 'A'); assert.include(str, 'B');