Jump to content

UniUconvToUcs

From EDM2
Revision as of 12:29, 20 April 2016 by Ak120 (talk | contribs)

UniUconvToUcs

UniUconvToUcs(uconvObj, inBuffer, inBufferLen, ucsBuffer, ucsBufferLen, nonIdenticalConv)
Convert a code page string to a UCS string.

Parameters

uconvObj - UconvObject - input
The conversion object created from UniCreateUconvObject.
inBuffer - (void **) - input
The input buffer.
inBufferLen - (size_t *) - input/output
The input buffer's length, in bytes.
ucsBuffer - UniChar - output
The ucs buffer.
ucsBufferLen - (size_t *) - output
Number of unicode character elements in the ucsBuffer.
nonIdenticalConv - (size_t *) - output
Number of non-identical conversions.

Constants

None

Returns

An integer with values of:

UniconvToUcs updates the variables pointed to by the arguments to reflect the extent of the conversion and returns, in nonidentical, the number of substitutions (non-identical conversions) performed. If the entire string in the input buffer is converted, the value pointed to by inBufferLen will be 0. If the input conversion is stopped due to any condition mentioned above, the value pointed to by inBufferLen will be nonzero and a nonzero value is returned to indicate the condition. If an error occurs, UniUconvToUcs returns a nonzero value.

Module

Define (C/C++)

Export name/Ordinal

Calling conversion

Cdecl32

Example Code

UconvObject uconvObj;
void**      inBuffer;
size_t*     inBufferLen;
UniChar     ucsBuffer;
size_t*     ucsBufferLen;
size_t*     nonIdenticalConv;
integer     rc;
...
rc = UniUconvToUcs(uconvObj, inBuffer, inBufferLen, ucsBuffer, ucsBufferLen, nonIdenticalConv);
...

Related Functions

UniconvFromUcs UniStrFromUcs UniStrToUcs

Notes

The sequence of the code page characters in inBuffer is converted into a sequence of Unicode characters in ucsBuffer. The code page was set by UniCreateUnconvObject call in the UconvObject.

Conversion is only on bytes that convert. The process stops converting on the first non-valid byte. If the ucsBuffer isn't large enough, conversion ends on the byte previous to any buffer overflow. inBuffer is updated truncating the point of failure to the end and updating the ucsBufferLen to indicate the number of successfully converted elements.

OS Version Introduced

OS/2 Warp