UniUconvFromUcs: Difference between revisions
No edit summary |
mNo edit summary |
||
Line 3: | Line 3: | ||
=== Parameters === | === Parameters === | ||
; uconvObj - [[ | ; uconvObj - [[UconvObject]] - input : The conversion object created from [[UniCreateUconvObject]]. | ||
; ucsBuffer - [[ | ; ucsBuffer - [[UniChar]] - input : The input buffer. | ||
; ucsBufferLen - (size_t *) - input/output : The input buffer's length, in bytes. | ; ucsBufferLen - (size_t *) - input/output : The input buffer's length, in bytes. | ||
; outBuff - (void **) - output : The output buffer. | ; outBuff - (void **) - output : The output buffer. | ||
Line 26: | Line 26: | ||
* [[OS2 API:Unicode:error#ULS_SUCCESS|ULS_SUCCESS]] | * [[OS2 API:Unicode:error#ULS_SUCCESS|ULS_SUCCESS]] | ||
'''UniUconvFromUcs''' updates the variables pointed to by the arguments to reflect the extent of the conversion and returns, in nonidentical, the number of substitution (nonidentical conversions) performed. If the entire string in the input buffer is converted, the value pointed to by ucsBufferLen will be 0. If the input conversion is stopped due to any condition mentioned above, the value pointed to by ucsBufferLen will be nonzero. If any error occurs, [[UniUconvToUcs]] returns a nonzero value. | |||
=== Calling conversion === | === Calling conversion === | ||
Line 38: | Line 32: | ||
=== Example Code === | === Example Code === | ||
UconvObject uconvObj; | |||
UniChar ucsBuffer; | |||
size_t* ucsBufferLen; | size_t* ucsBufferLen; | ||
void** outBuff; | void** outBuff; | ||
Line 50: | Line 44: | ||
=== Related Functions === | === Related Functions === | ||
[[ | *[[UniconvToUcs]] | ||
[[ | *[[UniStrFromUcs]] | ||
[[ | *[[UniStrToUcs]] | ||
=== Notes === | === Notes === | ||
The sequence of the code page characters in ucsBuffer is converted into a sequence of Unicode characters in outBuff. | The sequence of the code page characters in ucsBuffer is converted into a sequence of Unicode characters in outBuff. The code page was set by [[UniCreateUnconvObject]] call in the [[UconvObject]]. | ||
Conversion is only on bytes that convert. | Conversion is only on bytes that convert. The process stops converting on the first non-valid byte. If the outBuff isn't large enough, conversion ends on the UniChar previous to any buffer overflow. outBuff is updated truncating the point of failure to the end and updating the outBuffLen to indicate the number of successfully converted elements. | ||
=== OS Version Introduced === | === OS Version Introduced === | ||
OS/2 Warp | OS/2 Warp | ||
[[Category:Uni]] | |||
[[Category: |
Revision as of 04:20, 5 December 2016
UniUconvFromUcs
- UniUconvFromUcs(uconvObj, ucsBuffer, ucsBufferLen, outBuff, outBuffLen, nonIdenticalConv)
- Convert a UCS string to code page characters.
Parameters
- uconvObj - UconvObject - input
- The conversion object created from UniCreateUconvObject.
- ucsBuffer - UniChar - input
- The input buffer.
- ucsBufferLen - (size_t *) - input/output
- The input buffer's length, in bytes.
- outBuff - (void **) - output
- The output buffer.
- outBuffLen - (size_t *) - output
- Number of code page character elements in the outBuff.
- nonIdenticalConv - (size_t *) - output
- Number of non-identical conversions.
Constants
None
Returns
An integer with values of:
UniUconvFromUcs updates the variables pointed to by the arguments to reflect the extent of the conversion and returns, in nonidentical, the number of substitution (nonidentical conversions) performed. If the entire string in the input buffer is converted, the value pointed to by ucsBufferLen will be 0. If the input conversion is stopped due to any condition mentioned above, the value pointed to by ucsBufferLen will be nonzero. If any error occurs, UniUconvToUcs returns a nonzero value.
Calling conversion
Example Code
UconvObject uconvObj; UniChar ucsBuffer; size_t* ucsBufferLen; void** outBuff; size_t* outBuffLen; size_t* nonIdenticalConv; integer rc; ... rc = UniUconvFromUcs(uconvObj, ucsBuffer, ucsBufferLen, outBuff, outBuffLen, nonIdenticalConv); ...
Related Functions
Notes
The sequence of the code page characters in ucsBuffer is converted into a sequence of Unicode characters in outBuff. 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 outBuff isn't large enough, conversion ends on the UniChar previous to any buffer overflow. outBuff is updated truncating the point of failure to the end and updating the outBuffLen to indicate the number of successfully converted elements.
OS Version Introduced
OS/2 Warp