We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6658f64 commit 751f564Copy full SHA for 751f564
web/assets/js/util/index.js
@@ -515,17 +515,22 @@ class ClipboardManager {
515
class Base64 {
516
static encode(content = "", safe = false) {
517
if (safe) {
518
- return window.btoa(content)
+ return Base64.encode(content)
519
.replace(/\+/g, '-')
520
.replace(/=/g, '')
521
.replace(/\//g, '_')
522
}
523
524
+ return window.btoa(
525
+ String.fromCharCode(...new TextEncoder().encode(content))
526
+ )
527
528
529
static decode(content = "") {
- return window.atob(content)
530
+ return new TextDecoder()
531
+ .decode(
532
+ Uint8Array.from(window.atob(content), c => c.charCodeAt(0))
533
534
535
536
0 commit comments