diff --git a/js/weechat.js b/js/weechat.js index 0b220b1..bd9870b 100644 --- a/js/weechat.js +++ b/js/weechat.js @@ -574,10 +574,13 @@ WeeChatProtocol._uia2s = function(uia) { if(!uia.length || uia[0] === 0) return ""; - var encodedString = String.fromCharCode.apply(null, uia), - decodedString = decodeURIComponent(escape(encodedString)); - - return decodedString; + try { + var encodedString = String.fromCharCode.apply(null, uia), + decodedString = decodeURIComponent(escape(encodedString)); + return decodedString; + } catch (exception) { + return "--Sorry, Glowing Bear cannot decode this line as it is invalid--"; + } }; /**