Answer the question
In order to leave comments, you need to log in
How to read a text file in nodeJs if you don't know its encoding?
You need to read the contents of a plain text file (.csv). The problem is that the files come from different platforms and in different encodings (UTF-8, UTF-16, Windows 125x, etc.). And when using it, FS.readFileSunc
you must specify the encoding explicitly. And if the file is different, then the contents of the file break.
Answer the question
In order to leave comments, you need to log in
when using FS.readFileSunc, you must specify the encoding explicitly
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question