00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef UNORM_H
00016 #define UNORM_H
00017
00018 #include "unicode/utypes.h"
00019 #include "unicode/uiter.h"
00020
00124 typedef enum {
00126 UNORM_NONE = 1,
00128 UNORM_NFD = 2,
00130 UNORM_NFKD = 3,
00132 UNORM_NFC = 4,
00134 UNORM_DEFAULT = UNORM_NFC,
00136 UNORM_NFKC =5,
00138 UNORM_FCD = 6,
00139
00141 UNORM_MODE_COUNT
00142
00143
00144
00145 #ifdef ICU_UNORM_USE_DEPRECATES
00146
00150 ,UCOL_NO_NORMALIZATION = 1,
00155 UCOL_DECOMP_CAN = 2,
00160 UCOL_DECOMP_COMPAT = 3,
00165 UCOL_DEFAULT_NORMALIZATION = UCOL_DECOMP_COMPAT,
00170 UCOL_DECOMP_CAN_COMP_COMPAT = 4,
00175 UCOL_DECOMP_COMPAT_COMP_CAN =5,
00176
00181 UCOL_IGNORE_HANGUL = 16,
00182
00187 UNORM_IGNORE_HANGUL = 16
00188 #endif
00189 } UNormalizationMode;
00190
00210 U_CAPI int32_t U_EXPORT2
00211 unorm_normalize(const UChar *source, int32_t sourceLength,
00212 UNormalizationMode mode, int32_t options,
00213 UChar *result, int32_t resultLength,
00214 UErrorCode *status);
00215
00216 #ifdef ICU_UNORM_USE_DEPRECATES
00217
00222 #define u_normalize unorm_normalize
00223 #endif
00224
00230 typedef enum UNormalizationCheckResult {
00234 UNORM_NO,
00238 UNORM_YES,
00243 UNORM_MAYBE
00244 } UNormalizationCheckResult;
00245
00266 U_CAPI UNormalizationCheckResult U_EXPORT2
00267 unorm_quickCheck(const UChar *source, int32_t sourcelength,
00268 UNormalizationMode mode,
00269 UErrorCode *status);
00270
00292 U_CAPI UBool U_EXPORT2
00293 unorm_isNormalized(const UChar *src, int32_t srcLength,
00294 UNormalizationMode mode,
00295 UErrorCode *pErrorCode);
00296
00370 U_CAPI int32_t U_EXPORT2
00371 unorm_next(UCharIterator *src,
00372 UChar *dest, int32_t destCapacity,
00373 UNormalizationMode mode, int32_t options,
00374 UBool doNormalize, UBool *pNeededToNormalize,
00375 UErrorCode *pErrorCode);
00376
00403 U_CAPI int32_t U_EXPORT2
00404 unorm_previous(UCharIterator *src,
00405 UChar *dest, int32_t destCapacity,
00406 UNormalizationMode mode, int32_t options,
00407 UBool doNormalize, UBool *pNeededToNormalize,
00408 UErrorCode *pErrorCode);
00409
00447 U_CAPI int32_t U_EXPORT2
00448 unorm_concatenate(const UChar *left, int32_t leftLength,
00449 const UChar *right, int32_t rightLength,
00450 UChar *dest, int32_t destCapacity,
00451 UNormalizationMode mode, int32_t options,
00452 UErrorCode *pErrorCode);
00453
00459 #define UNORM_INPUT_IS_FCD 0x20000
00460
00466 #define U_COMPARE_IGNORE_CASE 0x10000
00467
00468 #ifndef U_COMPARE_CODE_POINT_ORDER
00469
00475 #define U_COMPARE_CODE_POINT_ORDER 0x8000
00476 #endif
00477
00542 U_CAPI int32_t U_EXPORT2
00543 unorm_compare(const UChar *s1, int32_t length1,
00544 const UChar *s2, int32_t length2,
00545 uint32_t options,
00546 UErrorCode *pErrorCode);
00547
00548 #endif