TextEncoder = function TextEncoder() {
}
TextEncoder.prototype.encode = function(s) {
const e = new Uint8Array(s.length);
for (let i = 0; i < s.length; i += 1) {
e[i] = s.charCodeAt(i);
}
return e;
}
TextDecoder = function TextDecoder() {
}
TextDecoder.prototype.decode = function(arr) {
let d = "";
for (let i = 0; i < arr.length; i += 1) {
d += String.fromCharCode(arr[i]);
}
return d;
}
After bumping to v0.20.1, using Edge 44.18362.1.0, the console emits the following error:
'TextEncoder' is not defined
Microsoft's delightful Edge browser doesn't currently support TextEncoder or TextDecoder: https://caniuse.com/#feat=textencoder
This fixes it: