SecureString.convertEncoding(options)
Method Description |
Converts the content of a https.SecureString between two encodings. |
Returns |
The converted https.SecureString (not a new SecureString). |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
The encoding to be used to decode the current content of the SecureString. Use values from https.Encoding. |
|
string |
required |
The encoding to store the content as. Use values from https.Encoding. |
Errors
Error Code |
Thrown If |
---|---|
|
The content of the SecureString is binary data and it does not represent a valid UTF-8–encoded string. |
|
The content of the SecureString is not a valid encoded string according to the |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/https Module Script Samples.
// Add additional code
...
var secureString1 = https.createSecureString({
input: "myString1"
});
log.debug("secureString1 before convertEncoding", secureString1);
secureString1.convertEncoding({
fromEncoding: https.Encoding.UTF_8,
toEncoding: https.Encoding.HEX
});
log.debug("secureString1 after convertEncoding", secureString1);
...
// Add additional code