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

**URL:** <https://forum.ionicframework.com/t/how-do-i-handle-non-utf-8-character-encoding/68847>\
**Category:** ionic-v3\
**Created:** [November 1, 2016, 7:58pm UTC](https://forum.ionicframework.com/t/how-do-i-handle-non-utf-8-character-encoding/68847 "2016-11-01T19:58:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![larssn](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@larssn](https://forum.ionicframework.com/u/larssn)\
**Post date:** [November 1, 2016, 7:58pm UTC](https://forum.ionicframework.com/t/how-do-i-handle-non-utf-8-character-encoding/68847/1 "2016-11-01T19:58:05Z")

</div>

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](https://en.wikipedia.org/wiki/Code_page_865).  
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.

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [November 1, 2016, 8:21pm UTC](https://forum.ionicframework.com/t/how-do-i-handle-non-utf-8-character-encoding/68847/2 "2016-11-01T20:21:19Z")

</div>

I would take a look at [iconv-lite](https://github.com/ashtuchkin/iconv-lite).

---

<div class="post-metadata">

**Author:** ![larssn](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@larssn](https://forum.ionicframework.com/u/larssn)\
**Post date:** [November 1, 2016, 8:23pm UTC](https://forum.ionicframework.com/t/how-do-i-handle-non-utf-8-character-encoding/68847/3 "2016-11-01T20:23:22Z")

</div>

Thanks a lot, will take a look at it
