From c1893b1e384e98d0fa4079fce5116c7f9c8eb3cc Mon Sep 17 00:00:00 2001 From: nuintun Date: Fri, 26 Feb 2016 16:23:42 +0800 Subject: [PATCH] update files --- bin/thread.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/thread.js b/bin/thread.js index 2b0ae6b..3e22cfe 100644 --- a/bin/thread.js +++ b/bin/thread.js @@ -27,7 +27,9 @@ function DecodeGenerator(){ charset = jschardet.detect(data).encoding; } - return charset ? iconv.decode(data, charset) : data.toString(); + return charset && iconv.encodingExists(charset) + ? iconv.decode(data, charset) + : data.toString(); } else { return ''; }