From e6d7ae8e2f7538b7c0e6a9c2e82e5a1b52f5632c Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 26 Jan 2017 22:32:33 -0500 Subject: [PATCH] Fix truncated reports with multi-byte characters --- components/zotero-protocol-handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/zotero-protocol-handler.js b/components/zotero-protocol-handler.js index bd2af05dc..c82fade40 100644 --- a/components/zotero-protocol-handler.js +++ b/components/zotero-protocol-handler.js @@ -1220,7 +1220,7 @@ AsyncChannel.prototype = { .createInstance(Components.interfaces.nsIScriptableUnicodeConverter); converter.charset = "UTF-8"; let inputStream = converter.convertToInputStream(data); - listenerWrapper.onDataAvailable(this, context, inputStream, 0, data.length); + listenerWrapper.onDataAvailable(this, context, inputStream, 0, inputStream.available()); listenerWrapper.onStopRequest(this, context, this.status); }