Base64DecodeUCharArray - cCharTranslate

Decodes a Base-64 encoded UChar Array

Type: Function

Return Data Type: UChar[]

Parameters: UChar[] UCharData

ParameterDescription
UCharDataBase-64 encoded UChar array


Return Value

Decoded array


Syntax
Function Base64DecodeUCharArray UChar[] UCharData Returns UChar[]

Call: Get Base64DecodeUCharArray UCharData to UCharArrayVariable


Description

Base64DecodeUCharArray decodes a Base-64 encoded UChar array.

This is often paired with Base64EncodeUCharArray.

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