From 9b40a72f7a11e33ae9f155adc9fa056fdbd83852 Mon Sep 17 00:00:00 2001 From: Forrest Li Date: Tue, 30 Jan 2018 11:16:59 -0500 Subject: [PATCH] fix(BinaryHelper): Use latin1 for text decoding Latin1 is single byte encoding, which is what we want for a 1-to-1 conversion of the arraybuffer to a string. --- Sources/IO/Core/BinaryHelper/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/IO/Core/BinaryHelper/index.js b/Sources/IO/Core/BinaryHelper/index.js index 4cc7f5f73c8..f1719dc061a 100644 --- a/Sources/IO/Core/BinaryHelper/index.js +++ b/Sources/IO/Core/BinaryHelper/index.js @@ -6,7 +6,7 @@ */ function arrayBufferToString(arrayBuffer) { if ('TextDecoder' in window) { - const decoder = new TextDecoder(); + const decoder = new TextDecoder('latin1'); return decoder.decode(arrayBuffer); } // fallback on platforms w/o TextDecoder