2

Having problems with TextDecoder decoding Uint8Array. (background info)

var staring = "hello";
var array = new Uint8Array(2);
array[0]=255;
array[1]=0;
var binary=(new TextDecoder("utf-8")).decode(array)
console.log(binary);

Should give me: hello\xFF\x00

But instead gives me: hello\xFD\x00

Am i doing something wrong?

n0sr3v
  • 21
  • 3

0 Answers0