michael@0: /* michael@0: ******************************************************************************* michael@0: * Copyright (c) 1996-2010, International Business Machines Corporation michael@0: * and others. All Rights Reserved. michael@0: ******************************************************************************* michael@0: * File unorm.h michael@0: * michael@0: * Created by: Vladimir Weinstein 12052000 michael@0: * michael@0: * Modification history : michael@0: * michael@0: * Date Name Description michael@0: * 02/01/01 synwee Added normalization quickcheck enum and method. michael@0: */ michael@0: #ifndef UNORM_H michael@0: #define UNORM_H michael@0: michael@0: #include "unicode/utypes.h" michael@0: michael@0: #if !UCONFIG_NO_NORMALIZATION michael@0: michael@0: #include "unicode/uiter.h" michael@0: #include "unicode/unorm2.h" michael@0: michael@0: /** michael@0: * \file michael@0: * \brief C API: Unicode Normalization michael@0: * michael@0: *
unorm_normalize
transforms Unicode text into an equivalent composed or
michael@0: * decomposed form, allowing for easier sorting and searching of text.
michael@0: * unorm_normalize
supports the standard normalization forms described in
michael@0: *
michael@0: * Unicode Standard Annex #15: Unicode Normalization Forms.
michael@0: *
michael@0: * Characters with accents or other adornments can be encoded in
michael@0: * several different ways in Unicode. For example, take the character A-acute.
michael@0: * In Unicode, this can be encoded as a single character (the
michael@0: * "composed" form):
michael@0: *
michael@0: * \code
michael@0: * 00C1 LATIN CAPITAL LETTER A WITH ACUTE
michael@0: * \endcode
michael@0: *
michael@0: * or as two separate characters (the "decomposed" form):
michael@0: *
michael@0: * \code
michael@0: * 0041 LATIN CAPITAL LETTER A
michael@0: * 0301 COMBINING ACUTE ACCENT
michael@0: * \endcode
michael@0: *
michael@0: * To a user of your program, however, both of these sequences should be
michael@0: * treated as the same "user-level" character "A with acute accent". When you are searching or
michael@0: * comparing text, you must ensure that these two sequences are treated
michael@0: * equivalently. In addition, you must handle characters with more than one
michael@0: * accent. Sometimes the order of a character's combining accents is
michael@0: * significant, while in other cases accent sequences in different orders are
michael@0: * really equivalent.
michael@0: *
michael@0: * Similarly, the string "ffi" can be encoded as three separate letters:
michael@0: *
michael@0: * \code
michael@0: * 0066 LATIN SMALL LETTER F
michael@0: * 0066 LATIN SMALL LETTER F
michael@0: * 0069 LATIN SMALL LETTER I
michael@0: * \endcode
michael@0: *
michael@0: * or as the single character
michael@0: *
michael@0: * \code
michael@0: * FB03 LATIN SMALL LIGATURE FFI
michael@0: * \endcode
michael@0: *
michael@0: * The ffi ligature is not a distinct semantic character, and strictly speaking
michael@0: * it shouldn't be in Unicode at all, but it was included for compatibility
michael@0: * with existing character sets that already provided it. The Unicode standard
michael@0: * identifies such characters by giving them "compatibility" decompositions
michael@0: * into the corresponding semantic characters. When sorting and searching, you
michael@0: * will often want to use these mappings.
michael@0: *
michael@0: * unorm_normalize
helps solve these problems by transforming text into the
michael@0: * canonical composed and decomposed forms as shown in the first example above.
michael@0: * In addition, you can have it perform compatibility decompositions so that
michael@0: * you can treat compatibility characters the same as their equivalents.
michael@0: * Finally, unorm_normalize
rearranges accents into the proper canonical
michael@0: * order, so that you do not have to worry about accent rearrangement on your
michael@0: * own.
michael@0: *
michael@0: * Form FCD, "Fast C or D", is also designed for collation.
michael@0: * It allows to work on strings that are not necessarily normalized
michael@0: * with an algorithm (like in collation) that works under "canonical closure", i.e., it treats precomposed
michael@0: * characters and their decomposed equivalents the same.
michael@0: *
michael@0: * It is not a normalization form because it does not provide for uniqueness of representation. Multiple strings
michael@0: * may be canonically equivalent (their NFDs are identical) and may all conform to FCD without being identical
michael@0: * themselves.
michael@0: *
michael@0: * The form is defined such that the "raw decomposition", the recursive canonical decomposition of each character,
michael@0: * results in a string that is canonically ordered. This means that precomposed characters are allowed for as long
michael@0: * as their decompositions do not need canonical reordering.
michael@0: *
michael@0: * Its advantage for a process like collation is that all NFD and most NFC texts - and many unnormalized texts -
michael@0: * already conform to FCD and do not need to be normalized (NFD) for such a process. The FCD quick check will
michael@0: * return UNORM_YES for most strings in practice.
michael@0: *
michael@0: * unorm_normalize(UNORM_FCD) may be implemented with UNORM_NFD.
michael@0: *
michael@0: * For more details on FCD see the collation design document:
michael@0: * http://source.icu-project.org/repos/icu/icuhtml/trunk/design/collation/ICU_collation_design.htm
michael@0: *
michael@0: * ICU collation performs either NFD or FCD normalization automatically if normalization
michael@0: * is turned on for the collator object.
michael@0: * Beyond collation and string search, normalized strings may be useful for string equivalence comparisons,
michael@0: * transliteration/transcription, unique representations, etc.
michael@0: *
michael@0: * The W3C generally recommends to exchange texts in NFC.
michael@0: * Note also that most legacy character encodings use only precomposed forms and often do not
michael@0: * encode any combining marks by themselves. For conversion to such character encodings the
michael@0: * Unicode text needs to be normalized to NFC.
michael@0: * For more usage examples, see the Unicode Standard Annex.
michael@0: */
michael@0:
michael@0: /**
michael@0: * Constants for normalization modes.
michael@0: * @stable ICU 2.0
michael@0: */
michael@0: typedef enum {
michael@0: /** No decomposition/composition. @stable ICU 2.0 */
michael@0: UNORM_NONE = 1,
michael@0: /** Canonical decomposition. @stable ICU 2.0 */
michael@0: UNORM_NFD = 2,
michael@0: /** Compatibility decomposition. @stable ICU 2.0 */
michael@0: UNORM_NFKD = 3,
michael@0: /** Canonical decomposition followed by canonical composition. @stable ICU 2.0 */
michael@0: UNORM_NFC = 4,
michael@0: /** Default normalization. @stable ICU 2.0 */
michael@0: UNORM_DEFAULT = UNORM_NFC,
michael@0: /** Compatibility decomposition followed by canonical composition. @stable ICU 2.0 */
michael@0: UNORM_NFKC =5,
michael@0: /** "Fast C or D" form. @stable ICU 2.0 */
michael@0: UNORM_FCD = 6,
michael@0:
michael@0: /** One more than the highest normalization mode constant. @stable ICU 2.0 */
michael@0: UNORM_MODE_COUNT
michael@0: } UNormalizationMode;
michael@0:
michael@0: /**
michael@0: * Constants for options flags for normalization.
michael@0: * Use 0 for default options,
michael@0: * including normalization according to the Unicode version
michael@0: * that is currently supported by ICU (see u_getUnicodeVersion).
michael@0: * @stable ICU 2.6
michael@0: */
michael@0: enum {
michael@0: /**
michael@0: * Options bit set value to select Unicode 3.2 normalization
michael@0: * (except NormalizationCorrections).
michael@0: * At most one Unicode version can be selected at a time.
michael@0: * @stable ICU 2.6
michael@0: */
michael@0: UNORM_UNICODE_3_2=0x20
michael@0: };
michael@0:
michael@0: /**
michael@0: * Lowest-order bit number of unorm_compare() options bits corresponding to
michael@0: * normalization options bits.
michael@0: *
michael@0: * The options parameter for unorm_compare() uses most bits for
michael@0: * itself and for various comparison and folding flags.
michael@0: * The most significant bits, however, are shifted down and passed on
michael@0: * to the normalization implementation.
michael@0: * (That is, from unorm_compare(..., options, ...),
michael@0: * options>>UNORM_COMPARE_NORM_OPTIONS_SHIFT will be passed on to the
michael@0: * internal normalization functions.)
michael@0: *
michael@0: * @see unorm_compare
michael@0: * @stable ICU 2.6
michael@0: */
michael@0: #define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20
michael@0:
michael@0: /**
michael@0: * Normalize a string.
michael@0: * The string will be normalized according the specified normalization mode
michael@0: * and options.
michael@0: * The source and result buffers must not be the same, nor overlap.
michael@0: *
michael@0: * @param source The string to normalize.
michael@0: * @param sourceLength The length of source, or -1 if NUL-terminated.
michael@0: * @param mode The normalization mode; one of UNORM_NONE,
michael@0: * UNORM_NFD, UNORM_NFC, UNORM_NFKC, UNORM_NFKD, UNORM_DEFAULT.
michael@0: * @param options The normalization options, ORed together (0 for no options).
michael@0: * @param result A pointer to a buffer to receive the result string.
michael@0: * The result string is NUL-terminated if possible.
michael@0: * @param resultLength The maximum size of result.
michael@0: * @param status A pointer to a UErrorCode to receive any errors.
michael@0: * @return The total buffer size needed; if greater than resultLength,
michael@0: * the output was truncated, and the error code is set to U_BUFFER_OVERFLOW_ERROR.
michael@0: * @stable ICU 2.0
michael@0: */
michael@0: U_STABLE int32_t U_EXPORT2
michael@0: unorm_normalize(const UChar *source, int32_t sourceLength,
michael@0: UNormalizationMode mode, int32_t options,
michael@0: UChar *result, int32_t resultLength,
michael@0: UErrorCode *status);
michael@0:
michael@0: /**
michael@0: * Performing quick check on a string, to quickly determine if the string is
michael@0: * in a particular normalization format.
michael@0: * Three types of result can be returned UNORM_YES, UNORM_NO or
michael@0: * UNORM_MAYBE. Result UNORM_YES indicates that the argument
michael@0: * string is in the desired normalized format, UNORM_NO determines that
michael@0: * argument string is not in the desired normalized format. A
michael@0: * UNORM_MAYBE result indicates that a more thorough check is required,
michael@0: * the user may have to put the string in its normalized form and compare the
michael@0: * results.
michael@0: *
michael@0: * @param source string for determining if it is in a normalized format
michael@0: * @param sourcelength length of source to test, or -1 if NUL-terminated
michael@0: * @param mode which normalization form to test for
michael@0: * @param status a pointer to a UErrorCode to receive any errors
michael@0: * @return UNORM_YES, UNORM_NO or UNORM_MAYBE
michael@0: *
michael@0: * @see unorm_isNormalized
michael@0: * @stable ICU 2.0
michael@0: */
michael@0: U_STABLE UNormalizationCheckResult U_EXPORT2
michael@0: unorm_quickCheck(const UChar *source, int32_t sourcelength,
michael@0: UNormalizationMode mode,
michael@0: UErrorCode *status);
michael@0:
michael@0: /**
michael@0: * Performing quick check on a string; same as unorm_quickCheck but
michael@0: * takes an extra options parameter like most normalization functions.
michael@0: *
michael@0: * @param src String that is to be tested if it is in a normalization format.
michael@0: * @param srcLength Length of source to test, or -1 if NUL-terminated.
michael@0: * @param mode Which normalization form to test for.
michael@0: * @param options The normalization options, ORed together (0 for no options).
michael@0: * @param pErrorCode ICU error code in/out parameter.
michael@0: * Must fulfill U_SUCCESS before the function call.
michael@0: * @return UNORM_YES, UNORM_NO or UNORM_MAYBE
michael@0: *
michael@0: * @see unorm_quickCheck
michael@0: * @see unorm_isNormalized
michael@0: * @stable ICU 2.6
michael@0: */
michael@0: U_STABLE UNormalizationCheckResult U_EXPORT2
michael@0: unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength,
michael@0: UNormalizationMode mode, int32_t options,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Test if a string is in a given normalization form.
michael@0: * This is semantically equivalent to source.equals(normalize(source, mode)) .
michael@0: *
michael@0: * Unlike unorm_quickCheck(), this function returns a definitive result,
michael@0: * never a "maybe".
michael@0: * For NFD, NFKD, and FCD, both functions work exactly the same.
michael@0: * For NFC and NFKC where quickCheck may return "maybe", this function will
michael@0: * perform further tests to arrive at a TRUE/FALSE result.
michael@0: *
michael@0: * @param src String that is to be tested if it is in a normalization format.
michael@0: * @param srcLength Length of source to test, or -1 if NUL-terminated.
michael@0: * @param mode Which normalization form to test for.
michael@0: * @param pErrorCode ICU error code in/out parameter.
michael@0: * Must fulfill U_SUCCESS before the function call.
michael@0: * @return Boolean value indicating whether the source string is in the
michael@0: * "mode" normalization form.
michael@0: *
michael@0: * @see unorm_quickCheck
michael@0: * @stable ICU 2.2
michael@0: */
michael@0: U_STABLE UBool U_EXPORT2
michael@0: unorm_isNormalized(const UChar *src, int32_t srcLength,
michael@0: UNormalizationMode mode,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Test if a string is in a given normalization form; same as unorm_isNormalized but
michael@0: * takes an extra options parameter like most normalization functions.
michael@0: *
michael@0: * @param src String that is to be tested if it is in a normalization format.
michael@0: * @param srcLength Length of source to test, or -1 if NUL-terminated.
michael@0: * @param mode Which normalization form to test for.
michael@0: * @param options The normalization options, ORed together (0 for no options).
michael@0: * @param pErrorCode ICU error code in/out parameter.
michael@0: * Must fulfill U_SUCCESS before the function call.
michael@0: * @return Boolean value indicating whether the source string is in the
michael@0: * "mode/options" normalization form.
michael@0: *
michael@0: * @see unorm_quickCheck
michael@0: * @see unorm_isNormalized
michael@0: * @stable ICU 2.6
michael@0: */
michael@0: U_STABLE UBool U_EXPORT2
michael@0: unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
michael@0: UNormalizationMode mode, int32_t options,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Iterative normalization forward.
michael@0: * This function (together with unorm_previous) is somewhat
michael@0: * similar to the C++ Normalizer class (see its non-static functions).
michael@0: *
michael@0: * Iterative normalization is useful when only a small portion of a longer
michael@0: * string/text needs to be processed.
michael@0: *
michael@0: * For example, the likelihood may be high that processing the first 10% of some
michael@0: * text will be sufficient to find certain data.
michael@0: * Another example: When one wants to concatenate two normalized strings and get a
michael@0: * normalized result, it is much more efficient to normalize just a small part of
michael@0: * the result around the concatenation place instead of re-normalizing everything.
michael@0: *
michael@0: * The input text is an instance of the C character iteration API UCharIterator.
michael@0: * It may wrap around a simple string, a CharacterIterator, a Replaceable, or any
michael@0: * other kind of text object.
michael@0: *
michael@0: * If a buffer overflow occurs, then the caller needs to reset the iterator to the
michael@0: * old index and call the function again with a larger buffer - if the caller cares
michael@0: * for the actual output.
michael@0: * Regardless of the output buffer, the iterator will always be moved to the next
michael@0: * normalization boundary.
michael@0: *
michael@0: * This function (like unorm_previous) serves two purposes:
michael@0: *
michael@0: * 1) To find the next boundary so that the normalization of the part of the text
michael@0: * from the current position to that boundary does not affect and is not affected
michael@0: * by the part of the text beyond that boundary.
michael@0: *
michael@0: * 2) To normalize the text up to the boundary.
michael@0: *
michael@0: * The second step is optional, per the doNormalize parameter.
michael@0: * It is omitted for operations like string concatenation, where the two adjacent
michael@0: * string ends need to be normalized together.
michael@0: * In such a case, the output buffer will just contain a copy of the text up to the
michael@0: * boundary.
michael@0: *
michael@0: * pNeededToNormalize is an output-only parameter. Its output value is only defined
michael@0: * if normalization was requested (doNormalize) and successful (especially, no
michael@0: * buffer overflow).
michael@0: * It is useful for operations like a normalizing transliterator, where one would
michael@0: * not want to replace a piece of text if it is not modified.
michael@0: *
michael@0: * If doNormalize==TRUE and pNeededToNormalize!=NULL then *pNeeded... is set TRUE
michael@0: * if the normalization was necessary.
michael@0: *
michael@0: * If doNormalize==FALSE then *pNeededToNormalize will be set to FALSE.
michael@0: *
michael@0: * If the buffer overflows, then *pNeededToNormalize will be undefined;
michael@0: * essentially, whenever U_FAILURE is true (like in buffer overflows), this result
michael@0: * will be undefined.
michael@0: *
michael@0: * @param src The input text in the form of a C character iterator.
michael@0: * @param dest The output buffer; can be NULL if destCapacity==0 for pure preflighting.
michael@0: * @param destCapacity The number of UChars that fit into dest.
michael@0: * @param mode The normalization mode.
michael@0: * @param options The normalization options, ORed together (0 for no options).
michael@0: * @param doNormalize Indicates if the source text up to the next boundary
michael@0: * is to be normalized (TRUE) or just copied (FALSE).
michael@0: * @param pNeededToNormalize Output flag indicating if the normalization resulted in
michael@0: * different text from the input.
michael@0: * Not defined if an error occurs including buffer overflow.
michael@0: * Always FALSE if !doNormalize.
michael@0: * @param pErrorCode ICU error code in/out parameter.
michael@0: * Must fulfill U_SUCCESS before the function call.
michael@0: * @return Length of output (number of UChars) when successful or buffer overflow.
michael@0: *
michael@0: * @see unorm_previous
michael@0: * @see unorm_normalize
michael@0: *
michael@0: * @stable ICU 2.1
michael@0: */
michael@0: U_STABLE int32_t U_EXPORT2
michael@0: unorm_next(UCharIterator *src,
michael@0: UChar *dest, int32_t destCapacity,
michael@0: UNormalizationMode mode, int32_t options,
michael@0: UBool doNormalize, UBool *pNeededToNormalize,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Iterative normalization backward.
michael@0: * This function (together with unorm_next) is somewhat
michael@0: * similar to the C++ Normalizer class (see its non-static functions).
michael@0: * For all details see unorm_next.
michael@0: *
michael@0: * @param src The input text in the form of a C character iterator.
michael@0: * @param dest The output buffer; can be NULL if destCapacity==0 for pure preflighting.
michael@0: * @param destCapacity The number of UChars that fit into dest.
michael@0: * @param mode The normalization mode.
michael@0: * @param options The normalization options, ORed together (0 for no options).
michael@0: * @param doNormalize Indicates if the source text up to the next boundary
michael@0: * is to be normalized (TRUE) or just copied (FALSE).
michael@0: * @param pNeededToNormalize Output flag indicating if the normalization resulted in
michael@0: * different text from the input.
michael@0: * Not defined if an error occurs including buffer overflow.
michael@0: * Always FALSE if !doNormalize.
michael@0: * @param pErrorCode ICU error code in/out parameter.
michael@0: * Must fulfill U_SUCCESS before the function call.
michael@0: * @return Length of output (number of UChars) when successful or buffer overflow.
michael@0: *
michael@0: * @see unorm_next
michael@0: * @see unorm_normalize
michael@0: *
michael@0: * @stable ICU 2.1
michael@0: */
michael@0: U_STABLE int32_t U_EXPORT2
michael@0: unorm_previous(UCharIterator *src,
michael@0: UChar *dest, int32_t destCapacity,
michael@0: UNormalizationMode mode, int32_t options,
michael@0: UBool doNormalize, UBool *pNeededToNormalize,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Concatenate normalized strings, making sure that the result is normalized as well.
michael@0: *
michael@0: * If both the left and the right strings are in
michael@0: * the normalization form according to "mode/options",
michael@0: * then the result will be
michael@0: *
michael@0: * \code
michael@0: * dest=normalize(left+right, mode, options)
michael@0: * \endcode
michael@0: *
michael@0: * With the input strings already being normalized,
michael@0: * this function will use unorm_next() and unorm_previous()
michael@0: * to find the adjacent end pieces of the input strings.
michael@0: * Only the concatenation of these end pieces will be normalized and
michael@0: * then concatenated with the remaining parts of the input strings.
michael@0: *
michael@0: * It is allowed to have dest==left to avoid copying the entire left string.
michael@0: *
michael@0: * @param left Left source string, may be same as dest.
michael@0: * @param leftLength Length of left source string, or -1 if NUL-terminated.
michael@0: * @param right Right source string. Must not be the same as dest, nor overlap.
michael@0: * @param rightLength Length of right source string, or -1 if NUL-terminated.
michael@0: * @param dest The output buffer; can be NULL if destCapacity==0 for pure preflighting.
michael@0: * @param destCapacity The number of UChars that fit into dest.
michael@0: * @param mode The normalization mode.
michael@0: * @param options The normalization options, ORed together (0 for no options).
michael@0: * @param pErrorCode ICU error code in/out parameter.
michael@0: * Must fulfill U_SUCCESS before the function call.
michael@0: * @return Length of output (number of UChars) when successful or buffer overflow.
michael@0: *
michael@0: * @see unorm_normalize
michael@0: * @see unorm_next
michael@0: * @see unorm_previous
michael@0: *
michael@0: * @stable ICU 2.1
michael@0: */
michael@0: U_STABLE int32_t U_EXPORT2
michael@0: unorm_concatenate(const UChar *left, int32_t leftLength,
michael@0: const UChar *right, int32_t rightLength,
michael@0: UChar *dest, int32_t destCapacity,
michael@0: UNormalizationMode mode, int32_t options,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Option bit for unorm_compare:
michael@0: * Both input strings are assumed to fulfill FCD conditions.
michael@0: * @stable ICU 2.2
michael@0: */
michael@0: #define UNORM_INPUT_IS_FCD 0x20000
michael@0:
michael@0: /**
michael@0: * Option bit for unorm_compare:
michael@0: * Perform case-insensitive comparison.
michael@0: * @stable ICU 2.2
michael@0: */
michael@0: #define U_COMPARE_IGNORE_CASE 0x10000
michael@0:
michael@0: #ifndef U_COMPARE_CODE_POINT_ORDER
michael@0: /* see also unistr.h and ustring.h */
michael@0: /**
michael@0: * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc:
michael@0: * Compare strings in code point order instead of code unit order.
michael@0: * @stable ICU 2.2
michael@0: */
michael@0: #define U_COMPARE_CODE_POINT_ORDER 0x8000
michael@0: #endif
michael@0:
michael@0: /**
michael@0: * Compare two strings for canonical equivalence.
michael@0: * Further options include case-insensitive comparison and
michael@0: * code point order (as opposed to code unit order).
michael@0: *
michael@0: * Canonical equivalence between two strings is defined as their normalized
michael@0: * forms (NFD or NFC) being identical.
michael@0: * This function compares strings incrementally instead of normalizing
michael@0: * (and optionally case-folding) both strings entirely,
michael@0: * improving performance significantly.
michael@0: *
michael@0: * Bulk normalization is only necessary if the strings do not fulfill the FCD
michael@0: * conditions. Only in this case, and only if the strings are relatively long,
michael@0: * is memory allocated temporarily.
michael@0: * For FCD strings and short non-FCD strings there is no memory allocation.
michael@0: *
michael@0: * Semantically, this is equivalent to
michael@0: * strcmp[CodePointOrder](NFD(foldCase(NFD(s1))), NFD(foldCase(NFD(s2))))
michael@0: * where code point order and foldCase are all optional.
michael@0: *
michael@0: * UAX 21 2.5 Caseless Matching specifies that for a canonical caseless match
michael@0: * the case folding must be performed first, then the normalization.
michael@0: *
michael@0: * @param s1 First source string.
michael@0: * @param length1 Length of first source string, or -1 if NUL-terminated.
michael@0: *
michael@0: * @param s2 Second source string.
michael@0: * @param length2 Length of second source string, or -1 if NUL-terminated.
michael@0: *
michael@0: * @param options A bit set of options:
michael@0: * - U_FOLD_CASE_DEFAULT or 0 is used for default options:
michael@0: * Case-sensitive comparison in code unit order, and the input strings
michael@0: * are quick-checked for FCD.
michael@0: *
michael@0: * - UNORM_INPUT_IS_FCD
michael@0: * Set if the caller knows that both s1 and s2 fulfill the FCD conditions.
michael@0: * If not set, the function will quickCheck for FCD
michael@0: * and normalize if necessary.
michael@0: *
michael@0: * - U_COMPARE_CODE_POINT_ORDER
michael@0: * Set to choose code point order instead of code unit order
michael@0: * (see u_strCompare for details).
michael@0: *
michael@0: * - U_COMPARE_IGNORE_CASE
michael@0: * Set to compare strings case-insensitively using case folding,
michael@0: * instead of case-sensitively.
michael@0: * If set, then the following case folding options are used.
michael@0: *
michael@0: * - Options as used with case-insensitive comparisons, currently:
michael@0: *
michael@0: * - U_FOLD_CASE_EXCLUDE_SPECIAL_I
michael@0: * (see u_strCaseCompare for details)
michael@0: *
michael@0: * - regular normalization options shifted left by UNORM_COMPARE_NORM_OPTIONS_SHIFT
michael@0: *
michael@0: * @param pErrorCode ICU error code in/out parameter.
michael@0: * Must fulfill U_SUCCESS before the function call.
michael@0: * @return <0 or 0 or >0 as usual for string comparisons
michael@0: *
michael@0: * @see unorm_normalize
michael@0: * @see UNORM_FCD
michael@0: * @see u_strCompare
michael@0: * @see u_strCaseCompare
michael@0: *
michael@0: * @stable ICU 2.2
michael@0: */
michael@0: U_STABLE int32_t U_EXPORT2
michael@0: unorm_compare(const UChar *s1, int32_t length1,
michael@0: const UChar *s2, int32_t length2,
michael@0: uint32_t options,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: #endif /* #if !UCONFIG_NO_NORMALIZATION */
michael@0:
michael@0: #endif