How do I handle non-UTF-8 character encoding?

I’m in a situation where I need to print to a very basic printer, that only supports the basic code pages.

I need it to print in preferably the code page CP865.
Needless to say, its not doing that: I’m missing certain Scandinavian characters: æøåÆØÅ.

I figure its related to how the characters are encoded in Ionic/Javascript.

How can I approach the problem? Is there a way to convert from say, UTF-8 to CP865 before sending to the printer, or do I need to figure out the code point of these special characters, and then search replace every string sent to the printer?

Help would be greatly appreciated.

I would take a look at iconv-lite.

1 Like

Thanks a lot, will take a look at it