https://developer.mozilla.org/en-US/...dowBase64/btoa
Цитата:
|
Unicode strings
In most browsers, calling window.btoa() on a Unicode string will cause an InvalidCharacterError exception.
One option is to escape any extended characters so that the string you actually encode is an ASCII representation of the original.
|
function utf8_to_b64(str) {
return window.btoa(escape(encodeURIComponent(str)));
}
function b64_to_utf8(str) {
return decodeURIComponent(unescape(window.atob(str)));
}
var temp = utf8_to_b64("CMiPqOCPu8kCFYHbcgodoPABOQ");
temp = b64_to_utf8(temp);
alert(temp == "CMiPqOCPu8kCFYHbcgodoPABOQ");//true
насчёт gclid, сам не вникал, но эта статейка вроде бы должна помочь реализовать подобное на js
https://deedpolloffice.com/blog/arti...clid-parameter