UniUconvFromUcs converts a sequence of code elements, in the array specified by ucsbuf, into a sequence of corresponding characters in another code page, in the array specified by outbuf. The code page of the outbuf is the string specified in the UniCreateUconvObject call that returned the conversion object, uconv_object. The ucsbuf argument points to a variable that points to the first UniChar in the input buffer, and the Unicharsleft indicates the number of UniChar elements to the end of the buffer to be converted. The outbuf argument points to a variable that points to the first available character in outbuf, and outbytesleft indicates the number of bytes available to the end of the buffer.

If a sequence of UniChar elements within ucsbuf does not form a valid code element, conversion stops after the previous successfully converted UniChar.

If the outbuf buffer is not large enough to hold the entire converted input, conversion stops just prior to the input UniChar that would cause the output buffer to overflow. The variable pointed to by ucsbuf is updated to point to the UniChar following the last UniChar successfully used in the conversion. The value pointed to by outbytesleft is decremented to reflect the number of bytes still available in outbuf.

If UniUconvFromUcs encounters a code element in the ucsbuf that is legal, but for which an identical character does not exist in the target code page, UniUconvFromUcs replaces the character with a predefined substitution character, if the attributes of the conversion object allow this operation. If substitution is not selected, an error is returned.


[Back: UniUconvFromUcs - Parameters]
[Next: UniUconvFromUcs - Related Functions]