I'm getting data from a serial port., including danish characters æøå = c6 f8 c5
I need to convert this to c3 a6 c3 b8 c3 a5
If i send the data through the iconv node, set the encoding to utf8, I just get <?> characters
I think the iconv is trying to convert the other way
Someone with the physical hardware is reading the data with the serial node and sending it over mqtt to me.
If he selects string, I receive each æøå as <?>
If he selects buffer I get "Test æ ø å" as
[84,101,115,116,32,198,32,248,32,197]
I want to convert it to
[84,101,115,116,32,195,166,195,184,195,165]
If I put it thru iconv(utf8) I get
[84,101,115,116,32,239,191,189,32,239,191,189,32,239,191,189]
239,191,189 = <?>
To see what actual bytes I'm getting, I use
const buf = Buffer.from(msg.payload)
msg.payload=buf
return msg;
But even without converting to buffer, I still get the <?>