I have a project using Node.JS. I need to send a string to the terminal (UART COM-port) in Latin1. I just realised that I cannot create String
object with 1-byte encoding (like Latin-1).
I need to create string from array of bytes. Bytes that a less than 128 are ASCII bytes and string with these bytes always looks good. But if I pass bytes that are greater than 127 then I always retrieve string with 2 bytes (in UTF-16).
I really want only 1-byte representation of every byte. How can I achieve that?