webtelnet-proxy.js
function unicodeStringToTypedArray(s) {
    var escstr = encodeURIComponent(s);
    var binstr = escstr.replace(/%([0-9A-F]{2})/g, function(match, p1) {
        return String.fromCharCode('0x' + p1);
    });
    var ua = new Uint8Array(binstr.length);
    Array.prototype.forEach.call(binstr, function (ch, i) {
        ua[i] = ch.charCodeAt(0);
    });
    return ua;
}
function unicodeStringToTypedArray(s) {
    var escstr = encodeURIComponent(s);
    var binstr = escstr.replace(/%([0-9A-F]{2})/g, function(match, p1) {
        return String.fromCharCode('0x' + p1);
    });
    var ua = new Uint8Array(binstr.length);
    Array.prototype.forEach.call(binstr, function (ch, i) {
        ua[i] = ch.charCodeAt(0);
    });
    return ua;
}
function unicodeStringToTypedArray ( s ) { var escstr = encodeURIComponent ( s ) ; var binstr = escstr . replace ( / %([0-9A-F]{2}) / g , function ( match , p1 ) { return String . fromCharCode ( '0x' + p1 ) ; } ) ; var ua = new Uint8Array ( binstr . length ) ; Array . prototype . forEach . call ( binstr , function ( ch , i ) { ua [ i ] = ch . charCodeAt ( 0 ) ; } ) ; return ua ; }
string to uint array
string to uint array