27
rated 0 times
[
28]
[
1]
/ answers: 1 / hits: 174692
/ 11 Years ago, tue, september 10, 2013, 12:00:00
The .charCodeAt
function returns with the unicode code of the caracter. But I would like to get the byte array instead. I know, if the charcode is over 127, then the character is stored in two or more bytes.
var arr=[];
for(var i=0; i<str.length; i++) {
arr.push(str.charCodeAt(i))
}
More From » utf-8