Sunday 11 February 2018

String Decoding - Issue with UTF8 Characters

I've decided to move my project to Node.js, however I encountered a problem right at the beginning. Unfortunately, some unicode characters which my alphabet has does not appear correctly when I decode strings which I get via net module's sockets. I've researched and ended up using iconv-lite module, which solved my issue, now I can encode and decode strings just fine. However, when compared with buff.toString(), decoder.write(buff) seems approximately 3 times slower in my use cases. What would you recommend to make it work faster? Should I write my own decoder, presumably with c++ to make it faster? Do you think would it help to have a proxy between client and my program to do the decoding and hand correct output to node.js? (that probably makes less sense compared to a c++ add-on) I think I've read in the documentation that it is possible to build node.js with different language options. Should I choose that route?Thank you

Submitted February 11, 2018 at 06:48AM by safeTell

No comments:

Post a Comment