Script to encode/decode Unicode filenames to base64
I tried in a script the following functions to convert UTF8 names to base64 and viceversa, but it seems that `btoa` function is not recognized:
function utf8_to_b64( str ) {
return btoa(unescape(encodeURIComponent( str )));
}
function b64_to_utf8( str ) {
return decodeURIComponent(escape(atob( str )));
}
Prepending `btoa` with `app.` or `window.` does not help either.
Thanks in advance for any help.
function utf8_to_b64( str ) {
return btoa(unescape(encodeURIComponent( str )));
}
function b64_to_utf8( str ) {
return decodeURIComponent(escape(atob( str )));
}
Prepending `btoa` with `app.` or `window.` does not help either.
Thanks in advance for any help.