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.

Note:

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 scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/file Module

Since

2015.2

Values

Value

Character Set

UTF_8

Unicode

WINDOWS_1252

Western

ISO_8859_1

Western

GB18030

Chinese Simplified

SHIFT_JIS

Japanese

MAC_ROMAN

Western

GB2312

Chinese Simplified

BIG5

Chinese Traditional

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/file Module Script Samples.

          //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 

        

Related Topics

General Notices