Skip to content

Commit 8de27ea

Browse files
committed
MAGETWO-57816: [Backport] - [GitHub] UTF-8 special character issue in widgets #4232 - for 2.0
1 parent 54d4e70 commit 8de27ea

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/web/legacy-build.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/web/mage/adminhtml/tools.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,12 +332,12 @@ var Base64 = {
332332
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
333333
var i = 0;
334334

335+
input = Base64._utf8_encode(input);
336+
335337
if( typeof window.btoa === "function" ){
336338
return window.btoa(input);
337339
}
338340

339-
input = Base64._utf8_encode(input);
340-
341341
while (i < input.length) {
342342

343343
chr1 = input.charCodeAt(i++);
@@ -370,7 +370,7 @@ var Base64 = {
370370
var i = 0;
371371

372372
if( typeof window.atob === "function" ){
373-
return window.atob(input);
373+
return Base64._utf8_decode(window.atob(input));
374374
}
375375

376376
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
@@ -395,8 +395,8 @@ var Base64 = {
395395
output = output + String.fromCharCode(chr3);
396396
}
397397
}
398-
output = Base64._utf8_decode(output);
399-
return output;
398+
399+
return Base64._utf8_decode(output);
400400
},
401401

402402
mageEncode: function(input){

0 commit comments

Comments
 (0)