UniStrFromUcs: Difference between revisions
Appearance
m corrected variable name |
m correction |
||
Line 4: | Line 4: | ||
=== Parameters === | === Parameters === | ||
; uconvObj - [[OS2 API:DataType:UconvObject|UconvObject]] - input : The conversion object created from [[OS2_API:UniCreateUconvObject|UniCreateUconvObject]]. | ; uconvObj - [[OS2 API:DataType:UconvObject|UconvObject]] - input : The conversion object created from [[OS2_API:UniCreateUconvObject|UniCreateUconvObject]]. | ||
; outBuffer - [[OS2 API:DataType:CHAR|CHAR]] - | ; outBuffer - [[OS2 API:DataType:CHAR|CHAR]] - output : The output buffer to hold code page. | ||
; ucsString - [[OS2 API:DataType:UniChar|UniChar]] - input : Null terminated Unicode string. | ; ucsString - [[OS2 API:DataType:UniChar|UniChar]] - input : Null terminated Unicode string. | ||
; outBufferLen - (int) - input/output : The output buffer's length, in bytes. | ; outBufferLen - (int) - input/output : The output buffer's length, in bytes. |
Revision as of 21:29, 4 December 2006
UniStrFromUcs
- UniStrFromUcs(uconvObj, outBuffer, ucsString, outBufferLen)
- Convert a UCS string to a code page string.
Parameters
- uconvObj - UconvObject - input
- The conversion object created from UniCreateUconvObject.
- outBuffer - CHAR - output
- The output buffer to hold code page.
- ucsString - UniChar - input
- Null terminated Unicode string.
- outBufferLen - (int) - input/output
- The output buffer's length, in bytes.
Constants
None
Returns
An integer with values of:
Module
Define (C/C++)
Export name/Ordinal
Calling conversion
Example Code
UconvObject uconvObj; CHAR* outBuffer; UniChar ucsString; integer outBufferLen; APIRET rc; ... rc = UniStrFromUcs(uconvObj, outBuffer, ucsString, outBufferLen); ...
Related Functions
UniconvFromUcs UniconvToUcs UniStrToUcs
Notes
The sequence of code elements in ucsString is converted into a sequence of code page characters to outBuffer. The code page was set by UniCreateUnconvObject call in the UconvObject.
If the outBuffer isn't large enough, conversion ends on the byte previous to any buffer overflow. outBuffer is updated truncating the point of failure to the end and updating the outBufferLen to indicate the number of successfully converted bytes.
If UniStrFromUcs contains a code sequence in ucsString that is legal with no corresponding character in the target codepage this function will replace it with a predefined substituted character.
OS Version Introduced
OS/2 Warp