KCML_encode
Purpose
Convert from UTF-8 into an encoding
Definition
DEFSUB 'KCML_encode(sFmt$, BYREF sIn$, BYREF iBytesIn, BYREF sOut$, BYREF iBytesOut, iPosIn = 1, iPosOut = 1) AS KCML_XLAT_ERR
Parameters
| sFmt | Output string encoding, "CP" for current codepage |
| sIn | Input UTF-8 string |
| iBytesIn | [in] Size in bytes of input buffer, [out] bytes successfully read |
| sOut | Output buffer, ignored if iOut is zero |
| iBytesOut | [in] Size in bytes of output buffer, [out] bytes successfully written |
| iPosIn | Optional. 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. |
| iPosOut | Optional. 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 from UTF-8 into 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.