Encoding
Functions for encoding, decoding, serializing, and escaping values.
encoding::base64_decode
1-parameter signature
encoding::base64_decode(text)
base64_decode decodes standard padded Base64, preserving arbitrary bytes. Invalid encoding returns an error.
- Parameters
textStringThe encoded data.
- Returns
BinaryThe decoded bytes.
encoding::base64_encode
1-parameter signature
encoding::base64_encode(value)
base64_encode encodes raw bytes using standard padded Base64. Strings supply their UTF-8 bytes.
- Parameters
valueString | BinaryThe input data.
- Returns
StringStandard padded Base64 text.
encoding::html_escape
1-parameter signature
encoding::html_escape(text)
html_escape escapes the five HTML-sensitive characters: ampersand, angle brackets, and quotes.
- Parameters
textStringThe input string.
- Returns
StringThe converted string.
encoding::html_unescape
1-parameter signature
encoding::html_unescape(text)
html_unescape decodes HTML character references.
- Parameters
textStringThe input string.
- Returns
StringThe converted string.
encoding::json_parse
1-parameter signature
encoding::json_parse(str)
json_parse returns a value described by the JSON-encoded input string.
- Parameters
strStringThe string to parse as JSON.
- Returns
AnyParsed value.
encoding::json_stringify
1-parameter signature
encoding::json_stringify(str)
json_stringify returns a JSON string representation of the input value.
- Parameters
strAnyThe input value to serialize.
- Returns
StringJSON string.
encoding::query_escape
1-parameter signature
encoding::query_escape(text)
query_escape escapes query-form data: spaces become + and literal plus signs become %2B.
- Parameters
textStringThe input string.
- Returns
StringThe converted string.
encoding::query_unescape
1-parameter signature
encoding::query_unescape(text)
query_unescape decodes query-form data, including + as a space. Malformed percent escapes return an error.
- Parameters
textStringThe input string.
- Returns
StringThe converted string.