2

Hi everyone i am Adobe Extension developer, i stuck on creating a new text file with having encoding option "UCS-2 LE Bom" or "Unicode". In my extension node js is enabled, using node js i successfully creating txt file with default encoding (UTF-8) options, by passing "\ufeff' it will pointed to "UTF-8 BOM", this is what i am trying but not working..

 var fs = require('fs');
    var options = {encoding: 'ucs-2le' };
    var stream = fs.createWriteStream(dlFolderPath + 'body.txt', options);
    stream.once('open', function(fd){
        stream.write('\uFEFF'+data, options);
        stream.end();    
    });

and i want to create a text file with having encoding "UCS-2 LE BOM" or "Unicode". please suggest any ideas.

Shiva
  • 21
  • 6

0 Answers0