ENCODE64
9.0
The ENCODE64 instruction encodes into strict ASCII strings that can then be written to devices that cannot handle binary data. The instruction using the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
source
Required. A previously defined Character String Variable or Literal variable that is encoded.
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
dest
Required. A Character String Variable that receives the translated characters.
Flags Affected: EOS
Note the following:
The ENCODE64 instruction implements Base64 encoding as described in RFC2045, sec. 6.8. The main purpose of this instruction is to encode into strict ASCII strings for output to devices that cannot handle binary data.
The logical string of {source} is processed to transfer the translated characters to the {dest} variable.
This instruction translates sets of three (3) eight-bits/byte characters into four (4) six bits/byte characters with ASCII values of A-Z, a-z, '+', and '/'.
The EOS flag is set TRUE if the {source} variable is NULL. In this case, the {dest} variable is also set to NULL.
The OVER flag is set TRUE if the {dest} variable is too small to receive the translated characters as processed from the source logical string. The required size of the {dest} variable can be calculated as follows:
DestLen = ( ( ( SourceLength + 2 ) / 3 ) * 4 )
See Also: DECODE64, Character String Instructions
![]() |