0

In my NodeJS application, I need to read some text files with different encodings and out put it to console.

I use chardet module to detect encoding of the text files, however fs.readfile method don't like the detected encoding by chardet. It throws exception like "The value "ISO8859-9" is invalid for option "encoding"

Do you have any idea on how to output the contents of the text files?

Regards

serkanz
  • 391
  • 5
  • 21
  • Possible duplicate of [List of encodings that Node.js supports](https://stackoverflow.com/questions/14551608/list-of-encodings-that-node-js-supports) – Tom Blodget Apr 18 '19 at 00:13
  • I suggest that you focus on reading file to String. Writing String to console is a different thing—and it may or may not be a problem in your case. If you end up with a problem with that, search or submit a different question. – Tom Blodget Apr 18 '19 at 00:15

0 Answers0