From 10d8a1dc6d8ea9b0678c2ec36453d42a5bf401ba Mon Sep 17 00:00:00 2001 From: antisnatchor Date: Sat, 25 Jun 2011 17:11:07 +0000 Subject: [PATCH] (Fixes issue 354) fixed handling of raw unicode data in browsers that supports window.btoa and window.atob git-svn-id: https://beef.googlecode.com/svn/trunk@1020 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- core/main/client/encode/base64.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/main/client/encode/base64.js b/core/main/client/encode/base64.js index fc7cb455d..b86a04147 100644 --- a/core/main/client/encode/base64.js +++ b/core/main/client/encode/base64.js @@ -8,7 +8,7 @@ beef.encode.base64 = { encode : function (input) { if (window.btoa) { - return btoa(input); + return btoa(unescape(encodeURIComponent(input))); } var output = ""; @@ -46,7 +46,7 @@ beef.encode.base64 = { decode : function (input) { if (window.atob) { - return atob(input); + return atob(escape(input)); } var output = "";