ftos.convert.base64.toString
Converts a Base64-encoded string into a JavaScript string using the specified character encoding (UTF-8, Unicode, UTF-7, ASCII, or UTF-32).
Syntax
Copy
ftos.toString(base64: string, encoding: "utf7" | "utf8" | "utf32" | "unicode" | "ascii"): string
| Parameter | Type | Description |
|---|---|---|
base64
|
string | Base64-encoded input string to convert. |
encoding
|
string | Character encoding for the output string. Possible values:
|
Return Value
A JavaScript string containing the decoded data, represented in the specified encoding.
Example
In this example:
- Take the SGVsbG8gV29ybGQ= Base64 string.
- We convert it to its JavaScript string representation Hello World.
- We store the result in the stringData variable.
Copy
var stringData = ftos.convert.base64.toString('SGVsbG8gV29ybGQ=', 'utf8);