KCML_decode

Purpose

Convert to UTF-8 from an encoding

Definition

DEFSUB 'KCML_decode(sFmt$, BYREF sIn$, BYREF iBytesIn, BYREF sOut$, BYREF iBytesOut, iPosIn = 1, iPosOut = 1) AS KCML_XLAT_ERR

Parameters

sFmtInput string encoding, "CP" for current codepage
sInInput string
iBytesIn[in] Size in bytes of input buffer, [out] bytes successfully read
sOutOutput buffer, ignored if iOut is zero
iBytesOut[in] Size in bytes of output buffer, [out] bytes successfully written
iPosInOptional. The position in bytes to start reading from the input buffer. If the input buffer is a field in a defrecord, this can be found using POS.
iPosOutOptional. The position in bytes to start writing to the output buffer. If the output buffer is a field in a defrecord, this can be found using POS.

Return

Zero for success, else a non-zero error code taken from the KCML_XLAT_ERR enumeration

Description

Convert to UTF-8 from an encoding. The input and output buffers can either be ordinary string variables, or field variables. To use field variables, the optional iPosIn and iPosOut arguments must be set to the starting position of the required field in the defrecord (counted from 1), as returned by POS.

See also

Internal KCML Functions, Internally defined structures and Internally defined enumerations and constants.