Skip to content

ToBase64

Encodes text as Base64 using a server text encoding.

1
myScript.ToBase64(value: string, encodingCodePage?: number):string

Parameters

string value
    The text to encode.

number encodingCodePage optional
    The .NET code-page number to use. Omit it for UTF-8.

Returns

The Base64 representation of the encoded text.

Remarks

Server workflow scripts only. FromBase64() with the same encoding reverses this conversion for text.

Examples

Encode text with UTF-8 or a code page

1
2
var utf8 = Script.ToBase64('Hello');            // 'SGVsbG8='
var latin = Script.ToBase64('Café', 1252);      // Windows-1252

See Also