Skip to content

Base64EncodeUCharArray - cCharTranslate

Base-64 encodes a UChar Array

Type: Function
Return Data Type: UChar[]

Parameters

Parameter Type Description
UCharData UChar[] Source UChar array

Syntax

Function Base64EncodeUCharArray UChar[] UCharData Returns UChar[]

Call Example

Get Base64EncodeUCharArray UCharData to UChar[]Variable

Description

Base64EncodeUCharArray Base-64 encodes a UChar array.

This is often paired with Base64DecodeUCharArray.

Sample

Use Windows.pkg
Use cCharTranslate.pkg

Object oCharTranslate is a cCharTranslate
End_Object

Procedure TestBase64EncodeUCharArray
    UChar[] ucIn ucOut ucOut2

    Move (StringToUCharArray("Pretend this is actually binary data")) to ucIn

    // base64Encode to Uchar array
    Get Base64EncodeUCharArray of oCharTranslate ucIn to ucOut

    // base64 decode from Uchar array 
    Get Base64DecodeUCharArray of oCharTranslate ucOut to ucOut2
    If not (IsSameArray(ucIn,ucOut2)) Begin
        Send Info_Box "Test Failed"
    End
End_Procedure

Send TestBase64EncodeUCharArray

Return Value

Base-64 encoded UCharArray