BASE64-DECODE function
- Last Updated: March 3, 2026
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Converts a Base64 character string into a binary value. The result is a MEMPTR containing the binary data.
Syntax
|
- expression
- A CHARACTER or LONGCHAR expression containing the string you want to convert.
Note: The
BASE64-ENCODE and BASE64-DECODE functions:- Use the Base64 Alphabet table as found in RFC 4648.
- Do not enforce line lengths with separators.
- Require use of the ‘=’ padding character.
- Do not implement the Filename Safe Alphabet needed for Base64URL encoding.
Note: The
BASE64-ENCODE,
BASE64-DECODE, HEX-ENCODE, and
HEX-DECODE functions do not do any byte ordering. However, the binary
output of these functions may be a binary data type such as a MEMPTR or RAW. If the target
of these operation’s output is another system where the order of bytes (endianness) differs,
you must first normalize the data to what the receiving side is expecting. Otherwise, the
results may not be as expected. For example, for a MEMPTR value that you are building
yourself, you can use the SET-BYTE-ORDER statement to set the byte order for the
MEMPTR variable before you read or write the value.Example
The following example code uses the BASE64-DECODE
function:
|
Running this code displays the numeric byte values contained in the MEMPTR
returned by BASE64-DECODE, corresponding to the decoded binary data:
|