Having a problem here. I recieve data from hardware as HEX numbers. I use this to make them into strings(it is intended):
arr.push(data.charCodeAt(0).toString(16))
It works well. For example I recieve 0x00 and this code correctly adds a '0' string to the array.
But there is a problem. JS automatically understands these codes as symbols. And when I try 0xAA or 0x80 I recieve FFFD. As I understand. it means that there is no such symbol in utf-8.
How do I make js understand my data as hex-numbers, but not as symbol codes?
Edit: I figured out that my problem was in my wrong way of using the library which recieved data from hardware.