Jump to content

UniStrToUcs

From EDM2
Revision as of 08:10, 19 March 2006 by Daniel.lee.kruse (talk | contribs) (UniStrToUcs created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UniStrToUcs

UniStrToUcs(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:

Module

Define (C/C++)

INCL_???

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 = UniStrToUcs(uconvObj, inBuffer, inBufferLen, ucsBuffer, ucsBufferLen, nonIdenticalConv);
...

Related Functions

UniconvFromUcs UniconvToUcs UniStrFromUcs

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