DS Server

Javascript: TXTextControl.btoaUTF8 Method

Method|Introduced in 27.0

Description

Creates a base-64 encoded ASCII string from a unicode string. In contrast to the browser provided method btoa() this method handles all unicode characters and not only characters in the Latin1 range.

Syntax

<string> TXTextControl.btoaUTF8(<string> inputString, [<boolean> addBOM])

Parameters

ParameterDescription
inputString

A unicode string to be encoded into base-64.

addBOM

Optional. Set this to true if a byte order mark should be added to the encoded string.

Return Value

A base-64 encoded string.

Examples

The following example demonstrates TXTextControl.btoaUTF8 in a practical document-editing workflow. It creates a base-64 encoded ASCII string from a unicode string. In contrast to the browser provided method btoa() this method handles all unicode characters and not only characters in the Latin1 range.

TXTextControl.btoaUTF8("Quarterly report", true);