This query function performs Base64 decoding of a field. The decoded value
is subsequently decoded as binary representation of a string according to
the charset
parameter, which defaults to UTF-8. To
work with actual binary data, use ISO-8859-1 character set.
Function Traits: FieldComputationFunction
, Transformation
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
as | string | optional | _base64Decode | Name of the field in which to store the decoded value. |
charset | string | optional | UTF-8 | The character set to use when transforming bytes to string. Validated type is java.nio.char set.Charset . |
Valid Values | ISO-8859-1 | |||
UTF-8 | ||||
field [a] | string | required | The field on which to decode Base64 values. | |
The parameter name for field
can be omitted; the following forms are equivalent:
base64Decode("value")
and:
base64Decode(field="value")
Behavior on Invalid Encoding
An input field that does not contain a valid Base64 encoding may result in the following behavior:
Characters outside the base encoding alphabet are ignored.
If the base encoding is invalid, the output field is not created.
When decoding to a code point that is invalid with respect to the selected charset, the invalid code point is replaced with a placeholder character.
base64Decode()
Examples
Decode the Base64 value in encoded and stores it in decoded:
decoded := base64Decode(encoded)