#include "unicode/ucnv.h"
#include "unicode/utypes.h"
Go to the source code of this file.
Compounds | |
struct | UConverterFromUnicodeArgs |
struct | UConverterToUnicodeArgs |
Enumerations | |
enum | UConverterCallbackReason { UCNV_UNASSIGNED = 0, UCNV_ILLEGAL = 1, UCNV_IRREGULAR = 2, UCNV_RESET = 3, UCNV_CLOSE = 4 } |
The process condition code to be used with the callbacks. More... | |
Functions | |
U_CAPI void U_EXPORT2 | UCNV_FROM_U_CALLBACK_STOP ( void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar* codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode * err) |
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback STOPS at the ILLEGAL_SEQUENCE, returning the error code back to the caller immediately. More... | |
U_CAPI void U_EXPORT2 | UCNV_TO_U_CALLBACK_STOP ( void *context, UConverterToUnicodeArgs *fromUArgs, const char* codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode * err) |
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback STOPS at the ILLEGAL_SEQUENCE, returning the error code back to the caller immediately. More... | |
U_CAPI void U_EXPORT2 | UCNV_FROM_U_CALLBACK_SKIP ( void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar* codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode * err) |
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback skips any illegal sequence, simply ignoring those characters. More... | |
U_CAPI void U_EXPORT2 | UCNV_FROM_U_CALLBACK_SUBSTITUTE ( void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar* codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode * err) |
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback will Substitute the ILLEGAL SEQUENCE with the current substitution string for the converter. More... | |
U_CAPI void U_EXPORT2 | UCNV_FROM_U_CALLBACK_ESCAPE ( void *context, UConverterFromUnicodeArgs *fromUArgs, const UChar* codeUnits, int32_t length, UChar32 codePoint, UConverterCallbackReason reason, UErrorCode * err) |
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback will Substitute the ILLEGAL SEQUENCE with the hexadecimal representation of the illegal codepoints (in the format UXXXX, e.g. More... | |
U_CAPI void U_EXPORT2 | UCNV_TO_U_CALLBACK_SKIP ( void *context, UConverterToUnicodeArgs *fromUArgs, const char* codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode * err) |
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback skips any illegal sequence, simply ignoring those characters. More... | |
U_CAPI void U_EXPORT2 | UCNV_TO_U_CALLBACK_SUBSTITUTE ( void *context, UConverterToUnicodeArgs *fromUArgs, const char* codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode * err) |
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback will Substitute the ILLEGAL SEQUENCE with the Unicode substitution character, U+FFFD. More... | |
U_CAPI void U_EXPORT2 | UCNV_TO_U_CALLBACK_ESCAPE ( void *context, UConverterToUnicodeArgs *fromUArgs, const char* codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode * err) |
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback will Substitute the ILLEGAL SEQUENCE with the hexadecimal representation of the illegal bytes (in the format XNN, e.g. More... |
These Functions, although public, should NEVER be called directly, they should be used as parameters to the ucnv_setFromUCallback and ucnv_setToUCallback functions, to set the behaviour of a converter when it encounters ILLEGAL/UNMAPPED/INVALID sequences.
usage example: 'STOP' doesn't need any context, but newContext could be set to something other than 'NULL' if needed.
UErrorCode err = U_ZERO_ERROR; UConverter* myConverter = ucnv_open("ibm-949", &err); void *newContext = NULL; void *oldContext; UConverterFromUCallback oldAction; if (U_SUCCESS(err)) { ucnv_setFromUCallBack(myConverter, UCNV_FROM_U_CALLBACK_STOP, newContext, &oldAction, &oldContext, &status); }
The code above tells "myConverter" to stop when it encounters a ILLEGAL/TRUNCATED/INVALID sequences when it is used to convert from Unicode -> Codepage. The behavior from Codepage to Unicode is not changed.
Definition in file ucnv_err.h.
|
The process condition code to be used with the callbacks.
Definition at line 66 of file ucnv_err.h. |
|
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback will Substitute the ILLEGAL SEQUENCE with the hexadecimal representation of the illegal codepoints (in the format UXXXX, e.g. "uFFFEu00ACuC8FE"). In the Event the converter doesn't support the characters {u,%}[A-F][0-9], it will substitute the illegal sequence with the substitution characters. Note that percent (%) was chosen because backslash (\) does not exist on many converters.
|
|
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback skips any illegal sequence, simply ignoring those characters.
|
|
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback STOPS at the ILLEGAL_SEQUENCE, returning the error code back to the caller immediately.
|
|
DO NOT CALL THIS FUNCTION DIRECTLY! This From Unicode callback will Substitute the ILLEGAL SEQUENCE with the current substitution string for the converter. This is the default callback.
|
|
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback will Substitute the ILLEGAL SEQUENCE with the hexadecimal representation of the illegal bytes (in the format XNN, e.g. "XFFX0AXC8X03").
|
|
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback skips any illegal sequence, simply ignoring those characters.
|
|
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback STOPS at the ILLEGAL_SEQUENCE, returning the error code back to the caller immediately.
|
|
DO NOT CALL THIS FUNCTION DIRECTLY! This To Unicode callback will Substitute the ILLEGAL SEQUENCE with the Unicode substitution character, U+FFFD.
|