Javascript: TXTextControl.btoaUTF8 Method
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
| Parameter | Description |
|---|---|
| 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);