00001 /* 00002 ********************************************************************** 00003 * Copyright (C) 1999, International Business Machines 00004 * Corporation and others. All Rights Reserved. 00005 ********************************************************************** 00006 * 00007 * 00008 * ucnv_err.h: 00009 * defines error behaviour functions called by T_UConverter_{from,to}Unicode 00010 * 00011 * These Functions, although public, should NEVER be called directly, they should be used as parameters to 00012 * the T_UConverter_setMissing{Char,Unicode}Action API, to set the behaviour of a converter 00013 * when it encounters ILLEGAL/UNMAPPED/INVALID sequences. 00014 * 00015 * usage example: 00016 * 00017 * ... 00018 * UErrorCode err = U_ZERO_ERROR; 00019 * UConverter* myConverter = T_UConverter_create("ibm-949", &err); 00020 * 00021 * if (U_SUCCESS(err)) 00022 * { 00023 * T_UConverter_setMissingUnicodeAction(myConverter, (MissingUnicodeAction)UCNV_FROM_U_CALLBACK_STOP, &err); 00024 * T_UConverter_setMissingCharAction(myConverter, (MissingCharAction)UCNV_TO_U_CALLBACK_SUBSTITUTE, &err); 00025 * } 00026 * ... 00027 * 00028 * The code above tells "myConverter" to stop when it encounters a ILLEGAL/TRUNCATED/INVALID sequences when it is used to 00029 * convert from Unicode -> Codepage. 00030 * and to substitute with a codepage specific substitutions sequence when converting from Codepage -> Unicode 00031 */ 00032 00033 00034 #ifndef UCNV_ERR_H 00035 #define UCNV_ERR_H 00036 00037 #include "unicode/ucnv.h" 00038 #include "unicode/utypes.h" 00039 00040 00045 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_STOP (UConverter * _this, 00046 char **target, 00047 const char *targetLimit, 00048 const UChar ** source, 00049 const UChar * sourceLimit, 00050 int32_t* offsets, 00051 UBool flush, 00052 UErrorCode * err); 00053 00054 00059 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_STOP (UConverter * _this, 00060 UChar ** target, 00061 const UChar * targetLimit, 00062 const char **source, 00063 const char *sourceLimit, 00064 int32_t* offsets, 00065 UBool flush, 00066 UErrorCode * err); 00067 00068 00069 00070 00075 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_SKIP (UConverter * _this, 00076 char **target, 00077 const char *targetLimit, 00078 const UChar ** source, 00079 const UChar * sourceLimit, 00080 int32_t* offsets, 00081 UBool flush, 00082 UErrorCode * err); 00083 00092 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_SUBSTITUTE (UConverter * _this, 00093 char **target, 00094 const char *targetLimit, 00095 const UChar ** source, 00096 const UChar * sourceLimit, 00097 int32_t* offsets, 00098 UBool flush, 00099 UErrorCode * err); 00100 00112 U_CAPI void U_EXPORT2 UCNV_FROM_U_CALLBACK_ESCAPE (UConverter * _this, 00113 char **target, 00114 const char *targetLimit, 00115 const UChar ** source, 00116 const UChar * sourceLimit, 00117 int32_t* offsets, 00118 UBool flush, 00119 UErrorCode * err); 00120 00121 00126 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_SKIP (UConverter * _this, 00127 UChar ** target, 00128 const UChar * targetLimit, 00129 const char **source, 00130 const char *sourceLimit, 00131 int32_t* offsets, 00132 UBool flush, 00133 UErrorCode * err); 00134 00135 00143 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_SUBSTITUTE (UConverter * _this, 00144 UChar ** target, 00145 const UChar * targetLimit, 00146 const char **source, 00147 const char *sourceLimit, 00148 int32_t* offsets, 00149 UBool flush, 00150 UErrorCode * err); 00151 00161 U_CAPI void U_EXPORT2 UCNV_TO_U_CALLBACK_ESCAPE (UConverter * _this, 00162 UChar ** target, 00163 const UChar * targetLimit, 00164 const char **source, 00165 const char *sourceLimit, 00166 int32_t* offsets, 00167 UBool flush, 00168 UErrorCode * err); 00169 00170 00171 #endif/*UCNV_ERR_H*/