# HG changeset patch # User Bartłomiej Wołyńczyk # Date 2020-06-25 20:44:45 # Node ID 8708d303e06eddc2c47d2397ddf3f2f06e29f7cb # Parent fc1f6c1bb0e534ed2d90e18fa4c6dbd4cae45ac9 comments-history: Fix Utf8 to 64 encoding diff --git a/rhodecode/public/js/src/rhodecode/comments.js b/rhodecode/public/js/src/rhodecode/comments.js --- a/rhodecode/public/js/src/rhodecode/comments.js +++ b/rhodecode/public/js/src/rhodecode/comments.js @@ -1020,7 +1020,7 @@ var CommentsController = function() { initVersionSelector(versionSelectId, {results: preLoadVersionData}); - $comment.attr('data-comment-text', btoa(text)); + $comment.attr('data-comment-text', utf8ToB64(text)); var versionSelector = $('#comment_versions_'+comment_id); diff --git a/rhodecode/public/js/src/rhodecode/utils/string.js b/rhodecode/public/js/src/rhodecode/utils/string.js --- a/rhodecode/public/js/src/rhodecode/utils/string.js +++ b/rhodecode/public/js/src/rhodecode/utils/string.js @@ -188,3 +188,7 @@ function b64DecodeUnicode(str) { return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); }).join('')); } + +function utf8ToB64( str ) { + return window.btoa(unescape(encodeURIComponent( str ))); +} \ No newline at end of file