Why does this:
code:
function SetDataPatch(sUnicodeString) {
var newstring = "";
for (var i = 0; i < sUnicodeString.length; i++) {
var charCode = sUnicodeString.charCodeAt( i );
newstring += String.fromCharCode(charCode & 0xFF);
newstring += String.fromCharCode(charCode >>> 8);
}
return newstring;
}
Always output the first letter of the unicode string??? Can't figure it out...
Edit: more debuging showed me that the bitwise AND is outputing the charcode itself and the right bit shift is outputing "0".