Skip to content

ToBase64

Encodes text as Base64 using a server text encoding.

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.

Example

1
2
var encoded = Script.ToBase64("Merhaba"); // UTF-8 is the default
var turkishEncoded = Script.ToBase64("Merhaba", 1254); // Windows-1254

See Also