U_CAPI int32_t U_EXPORT2 ucnv_fromUChars (const UConverter * converter, char *target, int32_t targetCapacity, const UChar * source, UErrorCode * err)
Transcodes the source Unicode string to the target string in a codepage encoding
with the specified Unicode converter
Documentation
Transcodes the source Unicode string to the target string in a codepage encoding
with the specified Unicode converter. For example, if a Unicode to/from JIS
converter is specified, the source string in Unicode will be transcoded to JIS
encoding. The result will be stored in JIS encoding.
if any problems during conversion are encountered it will SUBSTITUTE with the default (initial)
substitute characters.
This function is a more convenient but less efficient version of ucnv_fromUnicode.
- Returns:
- number of bytes needed in target, regardless of targetCapacity
- Parameters:
- converter - the Unicode converter
source - the source Unicode string (zero Terminated)
target - the target string in codepage encoding (not zero-terminated because some
codepage do not use '\0' as a string terminator
targetCapacity - Input the number of bytes available in the target buffer
err - the error status code.
U_INDEX_OUTOFBOUNDS_ERROR will be returned if the
the # of bytes provided are not enough for transcoding.
U_ILLEGAL_ARGUMENT_ERROR is returned if the converter is NULL or the source or target string is empty.
U_BUFFER_OVERFLOW_ERROR when targetSize turns out to be bigger than targetCapacity
- See Also:
- ucnv_fromUnicode
ucnv_convert
alphabetic index hierarchy of classes
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de