-3

I am using fs.writefile and I can't save it in ANSI1255. The file is UTF-8 encoded.

  const encodedData = windows1255.encode(doc);

Don't work for me

shaedrich
  • 5,457
  • 3
  • 26
  • 42
Sagi
  • 3
  • 1
  • Can you explain _why_ this is impossible and what you tried? Have you read the [documentation](https://nodejs.org/api/fs.html#fs_filehandle_writefile_data_options)? – shaedrich Mar 25 '21 at 15:38

1 Answers1

0

Can't you just use the optional options.encoding param like this?

filehandle.writeFile(data, {
    encoding: 'ANSI1255' // or whatever it's called properly
});

If that doesn't work, this might: https://stackoverflow.com/a/53855344/7451109

shaedrich
  • 5,457
  • 3
  • 26
  • 42