RE: N/file : create file with encoding “ANSI”
I would like to convert the encoding UTF8 to ANSI with N/file module.
how to create a file with encoding ANSI, Please also suggest me.
<script>
var fileObj = file.create({
name : name,
fileType : file.Type.PLAINTEXT,
contents : contents, // the contents is encoding UTF8
folder : folderID
});
fileObj.isOnline = false;
//fileObj.encoding => ‘ANSI’ /*Can we save file with encoding ANSI?*/
var fileID = fileObj.save();
</script>
Thank you.
Your encoding options are found at file.Encoding. You probably want Windows 1252.
Thank you.