cwbNL_Convert

Purpose

Convert strings by using a previously opened converter.

Syntax

 
unsigned int CWB_ENTRY cwbNL_Convert(
                             cwbNL_Converter theConverter,
                             unsigned long   sourceLength,
                             unsigned long   targetLength,
                             char           *sourceBuffer,
                             char           *targetBuffer,
                             unsigned long  *numberOfErrors,
                             unsigned long  *firstErrorIndex,
                             unsigned long  *requiredLen,
                             cwbSV_ErrHandle errorHandle);

Parameters

cwbNL_Converter theConverter - output
Handle to the previously opened converter.
unsigned long sourceLength - input
Length of the source buffer.
unsigned long targetLength - input
Length of the target buffer. If converting from an ASCII code page that contains DBCS characters, note that the resulting data could contain shift-out and shift-in bytes. Therefore, the targetBuffer may need to be larger than the sourceBuffer.
char *sourceBuffer - input
Buffer containing the data to convert.
char *targetBuffer - output
Buffer to contain the converted data.
unsigned long *numberOfErrors - output
Contains the number of characters that could not be converted properly.
unsigned long *firstErrorIndex - output
Contains the offset of the first character in the source buffer that could not be converted properly.
unsigned long *requiredLen - output
Actual length of the result. If requiredLen > resultLen, the return value will be CWB_BUFFER_OVERFLOW.
cwbSV_ErrHandle errorHandle - output
Handle to an error object. Any returned messages will be written to this object. It is created with the cwbSV_CreateErrHandle API. The messages may be retrieved with the cwbSV_GetErrText API. If the parameter is set to zero, no messages will be retrievable.

Return Codes

The following list shows common return values.

CWB_OK
Successful completion.
CWB_INVALID_HANDLE
Invalid handle.
CWB_INVALID_POINTER
NULL passed on output parameter.
CWB_NOT_ENOUGH_MEMORY
Insufficient memory.
CWB_BUFFER_OVERFLOW
Output buffer too small, data truncated.

Usage

None