I have to send data to a connected object one byte chars. So I convert integer data to ASCII
with the help of String.fromCharCode()
.
As long as the integer is less than 127, then the caracter is stored in one byte. But beyond 128, which is normal, the data consists in more than one byte.
How can I deal with that ?
For sure I checked the number of bytes
using encodeURI(s).split(/%..|./).length - 1
I tried this SO post but it did not help much