UniStrToUcs: Difference between revisions
Appearance
m formatting |
m major IBM documentation mistakes |
||
Line 1: | Line 1: | ||
== UniStrToUcs == | == UniStrToUcs == | ||
; UniStrToUcs(uconvObj, inBuffer | ; UniStrToUcs(uconvObj, ucsBuffer, inBuffer, ucsBufferLen) : Convert a code page string to a UCS string. | ||
=== 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]]. | ||
; inBuffer - ( | ; ucsBuffer - [[OS2 API:DataType:UniChar|UniChar]] - output : The ucs buffer. | ||
; inBuffer - (character) - input : The input buffer that is null terminated. | |||
; ucsBufferLen - (integer) - input : Number of unicode character elements in the ucsBuffer. | |||
<!-- | |||
; inBufferLen - (size_t *) - input/output : The input buffer's length, in bytes. | ; inBufferLen - (size_t *) - input/output : The input buffer's length, in bytes. | ||
; nonIdenticalConv - (size_t *) - output : Number of non-identical conversions. | ; nonIdenticalConv - (size_t *) - output : Number of non-identical conversions. | ||
--> | |||
=== Constants === | === Constants === | ||
Line 32: | Line 34: | ||
=== Example Code === | === Example Code === | ||
[[OS2 API:DataType:UconvObject|UconvObject]] uconvObj; | [[OS2 API:DataType:UconvObject|UconvObject]] uconvObj; | ||
[[OS2 API:DataType:UniChar|UniChar]] ucsBuffer; | |||
void** inBuffer; | void** inBuffer; | ||
integer ucsBufferLen; | |||
integer rc; | integer rc; | ||
... | ... | ||
rc = UniStrToUcs(uconvObj, inBuffer | rc = UniStrToUcs(uconvObj, ucsBuffer, inBuffer, ucsBufferLen); | ||
... | ... | ||
Revision as of 17:38, 15 September 2006
UniStrToUcs
- UniStrToUcs(uconvObj, ucsBuffer, inBuffer, ucsBufferLen)
- Convert a code page string to a UCS string.
Parameters
- uconvObj - UconvObject - input
- The conversion object created from UniCreateUconvObject.
- ucsBuffer - UniChar - output
- The ucs buffer.
- inBuffer - (character) - input
- The input buffer that is null terminated.
- ucsBufferLen - (integer) - input
- Number of unicode character elements in the ucsBuffer.
Constants
None
Returns
An integer with values of:
Module
Define (C/C++)
Export name/Ordinal
Calling conversion
Example Code
UconvObject uconvObj; UniChar ucsBuffer; void** inBuffer; integer ucsBufferLen; integer rc; ... rc = UniStrToUcs(uconvObj, ucsBuffer, inBuffer, ucsBufferLen); ...
Related Functions
UniUconvFromUcs UniUconvToUcs 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