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?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.