Skip to content

DFSEC_EncodeUC

Include: Use System\Security.pkg

See Also: Encoding, DFSEC_Encode, DFSEC_DecodeUC

Purpose

Encodes a string or byte-compatible array and returns encoded bytes.

Syntax

Function DFSEC_EncodeUC Global DFSEC_ENCODING_FORMAT eFormat Variant vValue Returns UChar[]

Arguments

eFormat : Encoding format. Use one of the C_DFSEC_ENCODING_* constants.

vValue : DataFlex string or byte-compatible array to encode.

Returns

Encoded text as a UChar[] array.

Behavior

DFSEC_EncodeUC accepts the same input values as DFSEC_Encode, but returns the encoded result as UChar[].

Use this function when the caller wants encoded bytes instead of a String.

Empty input returns an empty array. An invalid format or unsupported value type raises DFERR_BAD_PARAMETER.

Example

UChar[] ucaEncoded

Get DFSEC_EncodeUC C_DFSEC_ENCODING_HEX "DataFlex" to ucaEncoded