Syntax

Platform.Function.Base64Encode(string[, charset])
1–2 arguments

Parameters

Name Type Required Description
string string Yes String to encode
charset string No Character set to use when encoding, such as ASCII or UTF-8

Description

Encodes a string value to Base64. Use the optional charset parameter to control encoding for non-ASCII strings.

For a single-argument form without charset control, see Base64Encode() under Global Functions.

Example

var normalStr = Platform.Function.Lookup("ForBase64Info", "ReceiptData", "ReceiptKey", "stringValue");
var encodedStr = Platform.Function.Base64Encode(normalStr);
Write(encodedStr);

See Also