I'm trying read from a file (The file is in Bulgarian) and with utf 8 it returns nonsense characters so I tried cp1251 but it throws: ERR_INVALID_OPT_VALUE_ENCODING.
var str = fs.readFileSync("./bank1/"+client,'cp1251');
I'm trying read from a file (The file is in Bulgarian) and with utf 8 it returns nonsense characters so I tried cp1251 but it throws: ERR_INVALID_OPT_VALUE_ENCODING.
var str = fs.readFileSync("./bank1/"+client,'cp1251');
Install iconv:
Use the code to read file encoded in
cp1251: