Modules

filter

 

Objects/Functions

module (N/file)

SuiteScript 2.0

file.Encoding

file.Encoding.{|UTF_8,WINDOWS_1252,ISO_8859_1,GB18030,SHIFT_JIS,MAC_ROMAN,GB2312,BIG5|}

N/file Module
file.Encoding
Enum Description: Enumeration that holds the string values for supported character encoding. This enum is used to set the value of the File.encoding property. JavaScript does not include an enumeration type. The SuiteScript 2.0 documentation utilizes the term enumeration (or enum) to describe the following: a plain JavaScript object with a flat, map-like structure. Within this object, each key points to a read-only string value.
Supported Script Types: Server-side scripts For more information, see SuiteScript 2.0 Script Types.
Module: N/file Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=file.Encoding

Example:

// Code Example 1
//Add additional code
//...
var fileObj = file.create({
name: 'test.txt',
fileType: file.Type.PLAINTEXT,
contents: 'Hello World\nHello World'
});
fileObj.encoding = file.Encoding.MAC_ROMAN;
fileObj.folder = 30;
var fileId = fileObj.save();
//...
//Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4228998505.html