Script to encode/decode to base64

Advanced Renamer forum
#1 : 10/02-21 00:41
Mario
Mario
Posts: 1
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.


10/02-21 00:41 - edited 11/02-21 01:48