On this Page
_fromBase64
(As of 3.1.002.10)
Convert a Base64-encoded string to plain text.
Syntax
_fromBase64
( string[,
bytesperchar])
Parameters
string is a base64-encoded string value to be converted.
bytesperchar is the coding size of the characters in the string parameter. The default is 1 indicating that each string character is to be converted to a single unicode output character. If the source string contains two encoded bytes that represent a single unicode character, then set bytesperchar to 2.
Returned Value
Returns the resulting unencoded string
Example
var str = "DocOrigin 2020"; var b64 = _toBase64(str); // "RG9jT3JpZ2luIDIwMjA=" var txt = _fromBase64(b64); // "DocOrigin 2020" var str2 = "保险单号"; var b64 = _toBase64(str2, 2); // "T92WaVNVU/c=" var txt = _fromBase64(b64, 2); // "保险单号"