unorm.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. /*
  2. *******************************************************************************
  3. * Copyright (c) 1996-2010, International Business Machines Corporation
  4. * and others. All Rights Reserved.
  5. *******************************************************************************
  6. * File unorm.h
  7. *
  8. * Created by: Vladimir Weinstein 12052000
  9. *
  10. * Modification history :
  11. *
  12. * Date Name Description
  13. * 02/01/01 synwee Added normalization quickcheck enum and method.
  14. */
  15. #ifndef UNORM_H
  16. #define UNORM_H
  17. #include "unicode/utypes.h"
  18. #if !UCONFIG_NO_NORMALIZATION
  19. #include "unicode/uiter.h"
  20. #include "unicode/unorm2.h"
  21. /**
  22. * \file
  23. * \brief C API: Unicode Normalization
  24. *
  25. * <h2>Unicode normalization API</h2>
  26. *
  27. * Note: This API has been replaced by the unorm2.h API and is only available
  28. * for backward compatibility. The functions here simply delegate to the
  29. * unorm2.h functions, for example unorm2_getInstance() and unorm2_normalize().
  30. * There is one exception: The new API does not provide a replacement for unorm_compare().
  31. *
  32. * <code>unorm_normalize</code> transforms Unicode text into an equivalent composed or
  33. * decomposed form, allowing for easier sorting and searching of text.
  34. * <code>unorm_normalize</code> supports the standard normalization forms described in
  35. * <a href="http://www.unicode.org/unicode/reports/tr15/" target="unicode">
  36. * Unicode Standard Annex #15: Unicode Normalization Forms</a>.
  37. *
  38. * Characters with accents or other adornments can be encoded in
  39. * several different ways in Unicode. For example, take the character A-acute.
  40. * In Unicode, this can be encoded as a single character (the
  41. * "composed" form):
  42. *
  43. * \code
  44. * 00C1 LATIN CAPITAL LETTER A WITH ACUTE
  45. * \endcode
  46. *
  47. * or as two separate characters (the "decomposed" form):
  48. *
  49. * \code
  50. * 0041 LATIN CAPITAL LETTER A
  51. * 0301 COMBINING ACUTE ACCENT
  52. * \endcode
  53. *
  54. * To a user of your program, however, both of these sequences should be
  55. * treated as the same "user-level" character "A with acute accent". When you are searching or
  56. * comparing text, you must ensure that these two sequences are treated
  57. * equivalently. In addition, you must handle characters with more than one
  58. * accent. Sometimes the order of a character's combining accents is
  59. * significant, while in other cases accent sequences in different orders are
  60. * really equivalent.
  61. *
  62. * Similarly, the string "ffi" can be encoded as three separate letters:
  63. *
  64. * \code
  65. * 0066 LATIN SMALL LETTER F
  66. * 0066 LATIN SMALL LETTER F
  67. * 0069 LATIN SMALL LETTER I
  68. * \endcode
  69. *
  70. * or as the single character
  71. *
  72. * \code
  73. * FB03 LATIN SMALL LIGATURE FFI
  74. * \endcode
  75. *
  76. * The ffi ligature is not a distinct semantic character, and strictly speaking
  77. * it shouldn't be in Unicode at all, but it was included for compatibility
  78. * with existing character sets that already provided it. The Unicode standard
  79. * identifies such characters by giving them "compatibility" decompositions
  80. * into the corresponding semantic characters. When sorting and searching, you
  81. * will often want to use these mappings.
  82. *
  83. * <code>unorm_normalize</code> helps solve these problems by transforming text into the
  84. * canonical composed and decomposed forms as shown in the first example above.
  85. * In addition, you can have it perform compatibility decompositions so that
  86. * you can treat compatibility characters the same as their equivalents.
  87. * Finally, <code>unorm_normalize</code> rearranges accents into the proper canonical
  88. * order, so that you do not have to worry about accent rearrangement on your
  89. * own.
  90. *
  91. * Form FCD, "Fast C or D", is also designed for collation.
  92. * It allows to work on strings that are not necessarily normalized
  93. * with an algorithm (like in collation) that works under "canonical closure", i.e., it treats precomposed
  94. * characters and their decomposed equivalents the same.
  95. *
  96. * It is not a normalization form because it does not provide for uniqueness of representation. Multiple strings
  97. * may be canonically equivalent (their NFDs are identical) and may all conform to FCD without being identical
  98. * themselves.
  99. *
  100. * The form is defined such that the "raw decomposition", the recursive canonical decomposition of each character,
  101. * results in a string that is canonically ordered. This means that precomposed characters are allowed for as long
  102. * as their decompositions do not need canonical reordering.
  103. *
  104. * Its advantage for a process like collation is that all NFD and most NFC texts - and many unnormalized texts -
  105. * already conform to FCD and do not need to be normalized (NFD) for such a process. The FCD quick check will
  106. * return UNORM_YES for most strings in practice.
  107. *
  108. * unorm_normalize(UNORM_FCD) may be implemented with UNORM_NFD.
  109. *
  110. * For more details on FCD see the collation design document:
  111. * http://source.icu-project.org/repos/icu/icuhtml/trunk/design/collation/ICU_collation_design.htm
  112. *
  113. * ICU collation performs either NFD or FCD normalization automatically if normalization
  114. * is turned on for the collator object.
  115. * Beyond collation and string search, normalized strings may be useful for string equivalence comparisons,
  116. * transliteration/transcription, unique representations, etc.
  117. *
  118. * The W3C generally recommends to exchange texts in NFC.
  119. * Note also that most legacy character encodings use only precomposed forms and often do not
  120. * encode any combining marks by themselves. For conversion to such character encodings the
  121. * Unicode text needs to be normalized to NFC.
  122. * For more usage examples, see the Unicode Standard Annex.
  123. */
  124. /**
  125. * Constants for normalization modes.
  126. * @stable ICU 2.0
  127. */
  128. typedef enum {
  129. /** No decomposition/composition. @stable ICU 2.0 */
  130. UNORM_NONE = 1,
  131. /** Canonical decomposition. @stable ICU 2.0 */
  132. UNORM_NFD = 2,
  133. /** Compatibility decomposition. @stable ICU 2.0 */
  134. UNORM_NFKD = 3,
  135. /** Canonical decomposition followed by canonical composition. @stable ICU 2.0 */
  136. UNORM_NFC = 4,
  137. /** Default normalization. @stable ICU 2.0 */
  138. UNORM_DEFAULT = UNORM_NFC,
  139. /** Compatibility decomposition followed by canonical composition. @stable ICU 2.0 */
  140. UNORM_NFKC =5,
  141. /** "Fast C or D" form. @stable ICU 2.0 */
  142. UNORM_FCD = 6,
  143. /** One more than the highest normalization mode constant. @stable ICU 2.0 */
  144. UNORM_MODE_COUNT
  145. } UNormalizationMode;
  146. /**
  147. * Constants for options flags for normalization.
  148. * Use 0 for default options,
  149. * including normalization according to the Unicode version
  150. * that is currently supported by ICU (see u_getUnicodeVersion).
  151. * @stable ICU 2.6
  152. */
  153. enum {
  154. /**
  155. * Options bit set value to select Unicode 3.2 normalization
  156. * (except NormalizationCorrections).
  157. * At most one Unicode version can be selected at a time.
  158. * @stable ICU 2.6
  159. */
  160. UNORM_UNICODE_3_2=0x20
  161. };
  162. /**
  163. * Lowest-order bit number of unorm_compare() options bits corresponding to
  164. * normalization options bits.
  165. *
  166. * The options parameter for unorm_compare() uses most bits for
  167. * itself and for various comparison and folding flags.
  168. * The most significant bits, however, are shifted down and passed on
  169. * to the normalization implementation.
  170. * (That is, from unorm_compare(..., options, ...),
  171. * options>>UNORM_COMPARE_NORM_OPTIONS_SHIFT will be passed on to the
  172. * internal normalization functions.)
  173. *
  174. * @see unorm_compare
  175. * @stable ICU 2.6
  176. */
  177. #define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20
  178. /**
  179. * Normalize a string.
  180. * The string will be normalized according the specified normalization mode
  181. * and options.
  182. * The source and result buffers must not be the same, nor overlap.
  183. *
  184. * @param source The string to normalize.
  185. * @param sourceLength The length of source, or -1 if NUL-terminated.
  186. * @param mode The normalization mode; one of UNORM_NONE,
  187. * UNORM_NFD, UNORM_NFC, UNORM_NFKC, UNORM_NFKD, UNORM_DEFAULT.
  188. * @param options The normalization options, ORed together (0 for no options).
  189. * @param result A pointer to a buffer to receive the result string.
  190. * The result string is NUL-terminated if possible.
  191. * @param resultLength The maximum size of result.
  192. * @param status A pointer to a UErrorCode to receive any errors.
  193. * @return The total buffer size needed; if greater than resultLength,
  194. * the output was truncated, and the error code is set to U_BUFFER_OVERFLOW_ERROR.
  195. * @stable ICU 2.0
  196. */
  197. U_STABLE int32_t U_EXPORT2
  198. unorm_normalize(const UChar *source, int32_t sourceLength,
  199. UNormalizationMode mode, int32_t options,
  200. UChar *result, int32_t resultLength,
  201. UErrorCode *status);
  202. /**
  203. * Performing quick check on a string, to quickly determine if the string is
  204. * in a particular normalization format.
  205. * Three types of result can be returned UNORM_YES, UNORM_NO or
  206. * UNORM_MAYBE. Result UNORM_YES indicates that the argument
  207. * string is in the desired normalized format, UNORM_NO determines that
  208. * argument string is not in the desired normalized format. A
  209. * UNORM_MAYBE result indicates that a more thorough check is required,
  210. * the user may have to put the string in its normalized form and compare the
  211. * results.
  212. *
  213. * @param source string for determining if it is in a normalized format
  214. * @param sourcelength length of source to test, or -1 if NUL-terminated
  215. * @param mode which normalization form to test for
  216. * @param status a pointer to a UErrorCode to receive any errors
  217. * @return UNORM_YES, UNORM_NO or UNORM_MAYBE
  218. *
  219. * @see unorm_isNormalized
  220. * @stable ICU 2.0
  221. */
  222. U_STABLE UNormalizationCheckResult U_EXPORT2
  223. unorm_quickCheck(const UChar *source, int32_t sourcelength,
  224. UNormalizationMode mode,
  225. UErrorCode *status);
  226. /**
  227. * Performing quick check on a string; same as unorm_quickCheck but
  228. * takes an extra options parameter like most normalization functions.
  229. *
  230. * @param src String that is to be tested if it is in a normalization format.
  231. * @param srcLength Length of source to test, or -1 if NUL-terminated.
  232. * @param mode Which normalization form to test for.
  233. * @param options The normalization options, ORed together (0 for no options).
  234. * @param pErrorCode ICU error code in/out parameter.
  235. * Must fulfill U_SUCCESS before the function call.
  236. * @return UNORM_YES, UNORM_NO or UNORM_MAYBE
  237. *
  238. * @see unorm_quickCheck
  239. * @see unorm_isNormalized
  240. * @stable ICU 2.6
  241. */
  242. U_STABLE UNormalizationCheckResult U_EXPORT2
  243. unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength,
  244. UNormalizationMode mode, int32_t options,
  245. UErrorCode *pErrorCode);
  246. /**
  247. * Test if a string is in a given normalization form.
  248. * This is semantically equivalent to source.equals(normalize(source, mode)) .
  249. *
  250. * Unlike unorm_quickCheck(), this function returns a definitive result,
  251. * never a "maybe".
  252. * For NFD, NFKD, and FCD, both functions work exactly the same.
  253. * For NFC and NFKC where quickCheck may return "maybe", this function will
  254. * perform further tests to arrive at a TRUE/FALSE result.
  255. *
  256. * @param src String that is to be tested if it is in a normalization format.
  257. * @param srcLength Length of source to test, or -1 if NUL-terminated.
  258. * @param mode Which normalization form to test for.
  259. * @param pErrorCode ICU error code in/out parameter.
  260. * Must fulfill U_SUCCESS before the function call.
  261. * @return Boolean value indicating whether the source string is in the
  262. * "mode" normalization form.
  263. *
  264. * @see unorm_quickCheck
  265. * @stable ICU 2.2
  266. */
  267. U_STABLE UBool U_EXPORT2
  268. unorm_isNormalized(const UChar *src, int32_t srcLength,
  269. UNormalizationMode mode,
  270. UErrorCode *pErrorCode);
  271. /**
  272. * Test if a string is in a given normalization form; same as unorm_isNormalized but
  273. * takes an extra options parameter like most normalization functions.
  274. *
  275. * @param src String that is to be tested if it is in a normalization format.
  276. * @param srcLength Length of source to test, or -1 if NUL-terminated.
  277. * @param mode Which normalization form to test for.
  278. * @param options The normalization options, ORed together (0 for no options).
  279. * @param pErrorCode ICU error code in/out parameter.
  280. * Must fulfill U_SUCCESS before the function call.
  281. * @return Boolean value indicating whether the source string is in the
  282. * "mode/options" normalization form.
  283. *
  284. * @see unorm_quickCheck
  285. * @see unorm_isNormalized
  286. * @stable ICU 2.6
  287. */
  288. U_STABLE UBool U_EXPORT2
  289. unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
  290. UNormalizationMode mode, int32_t options,
  291. UErrorCode *pErrorCode);
  292. /**
  293. * Iterative normalization forward.
  294. * This function (together with unorm_previous) is somewhat
  295. * similar to the C++ Normalizer class (see its non-static functions).
  296. *
  297. * Iterative normalization is useful when only a small portion of a longer
  298. * string/text needs to be processed.
  299. *
  300. * For example, the likelihood may be high that processing the first 10% of some
  301. * text will be sufficient to find certain data.
  302. * Another example: When one wants to concatenate two normalized strings and get a
  303. * normalized result, it is much more efficient to normalize just a small part of
  304. * the result around the concatenation place instead of re-normalizing everything.
  305. *
  306. * The input text is an instance of the C character iteration API UCharIterator.
  307. * It may wrap around a simple string, a CharacterIterator, a Replaceable, or any
  308. * other kind of text object.
  309. *
  310. * If a buffer overflow occurs, then the caller needs to reset the iterator to the
  311. * old index and call the function again with a larger buffer - if the caller cares
  312. * for the actual output.
  313. * Regardless of the output buffer, the iterator will always be moved to the next
  314. * normalization boundary.
  315. *
  316. * This function (like unorm_previous) serves two purposes:
  317. *
  318. * 1) To find the next boundary so that the normalization of the part of the text
  319. * from the current position to that boundary does not affect and is not affected
  320. * by the part of the text beyond that boundary.
  321. *
  322. * 2) To normalize the text up to the boundary.
  323. *
  324. * The second step is optional, per the doNormalize parameter.
  325. * It is omitted for operations like string concatenation, where the two adjacent
  326. * string ends need to be normalized together.
  327. * In such a case, the output buffer will just contain a copy of the text up to the
  328. * boundary.
  329. *
  330. * pNeededToNormalize is an output-only parameter. Its output value is only defined
  331. * if normalization was requested (doNormalize) and successful (especially, no
  332. * buffer overflow).
  333. * It is useful for operations like a normalizing transliterator, where one would
  334. * not want to replace a piece of text if it is not modified.
  335. *
  336. * If doNormalize==TRUE and pNeededToNormalize!=NULL then *pNeeded... is set TRUE
  337. * if the normalization was necessary.
  338. *
  339. * If doNormalize==FALSE then *pNeededToNormalize will be set to FALSE.
  340. *
  341. * If the buffer overflows, then *pNeededToNormalize will be undefined;
  342. * essentially, whenever U_FAILURE is true (like in buffer overflows), this result
  343. * will be undefined.
  344. *
  345. * @param src The input text in the form of a C character iterator.
  346. * @param dest The output buffer; can be NULL if destCapacity==0 for pure preflighting.
  347. * @param destCapacity The number of UChars that fit into dest.
  348. * @param mode The normalization mode.
  349. * @param options The normalization options, ORed together (0 for no options).
  350. * @param doNormalize Indicates if the source text up to the next boundary
  351. * is to be normalized (TRUE) or just copied (FALSE).
  352. * @param pNeededToNormalize Output flag indicating if the normalization resulted in
  353. * different text from the input.
  354. * Not defined if an error occurs including buffer overflow.
  355. * Always FALSE if !doNormalize.
  356. * @param pErrorCode ICU error code in/out parameter.
  357. * Must fulfill U_SUCCESS before the function call.
  358. * @return Length of output (number of UChars) when successful or buffer overflow.
  359. *
  360. * @see unorm_previous
  361. * @see unorm_normalize
  362. *
  363. * @stable ICU 2.1
  364. */
  365. U_STABLE int32_t U_EXPORT2
  366. unorm_next(UCharIterator *src,
  367. UChar *dest, int32_t destCapacity,
  368. UNormalizationMode mode, int32_t options,
  369. UBool doNormalize, UBool *pNeededToNormalize,
  370. UErrorCode *pErrorCode);
  371. /**
  372. * Iterative normalization backward.
  373. * This function (together with unorm_next) is somewhat
  374. * similar to the C++ Normalizer class (see its non-static functions).
  375. * For all details see unorm_next.
  376. *
  377. * @param src The input text in the form of a C character iterator.
  378. * @param dest The output buffer; can be NULL if destCapacity==0 for pure preflighting.
  379. * @param destCapacity The number of UChars that fit into dest.
  380. * @param mode The normalization mode.
  381. * @param options The normalization options, ORed together (0 for no options).
  382. * @param doNormalize Indicates if the source text up to the next boundary
  383. * is to be normalized (TRUE) or just copied (FALSE).
  384. * @param pNeededToNormalize Output flag indicating if the normalization resulted in
  385. * different text from the input.
  386. * Not defined if an error occurs including buffer overflow.
  387. * Always FALSE if !doNormalize.
  388. * @param pErrorCode ICU error code in/out parameter.
  389. * Must fulfill U_SUCCESS before the function call.
  390. * @return Length of output (number of UChars) when successful or buffer overflow.
  391. *
  392. * @see unorm_next
  393. * @see unorm_normalize
  394. *
  395. * @stable ICU 2.1
  396. */
  397. U_STABLE int32_t U_EXPORT2
  398. unorm_previous(UCharIterator *src,
  399. UChar *dest, int32_t destCapacity,
  400. UNormalizationMode mode, int32_t options,
  401. UBool doNormalize, UBool *pNeededToNormalize,
  402. UErrorCode *pErrorCode);
  403. /**
  404. * Concatenate normalized strings, making sure that the result is normalized as well.
  405. *
  406. * If both the left and the right strings are in
  407. * the normalization form according to "mode/options",
  408. * then the result will be
  409. *
  410. * \code
  411. * dest=normalize(left+right, mode, options)
  412. * \endcode
  413. *
  414. * With the input strings already being normalized,
  415. * this function will use unorm_next() and unorm_previous()
  416. * to find the adjacent end pieces of the input strings.
  417. * Only the concatenation of these end pieces will be normalized and
  418. * then concatenated with the remaining parts of the input strings.
  419. *
  420. * It is allowed to have dest==left to avoid copying the entire left string.
  421. *
  422. * @param left Left source string, may be same as dest.
  423. * @param leftLength Length of left source string, or -1 if NUL-terminated.
  424. * @param right Right source string. Must not be the same as dest, nor overlap.
  425. * @param rightLength Length of right source string, or -1 if NUL-terminated.
  426. * @param dest The output buffer; can be NULL if destCapacity==0 for pure preflighting.
  427. * @param destCapacity The number of UChars that fit into dest.
  428. * @param mode The normalization mode.
  429. * @param options The normalization options, ORed together (0 for no options).
  430. * @param pErrorCode ICU error code in/out parameter.
  431. * Must fulfill U_SUCCESS before the function call.
  432. * @return Length of output (number of UChars) when successful or buffer overflow.
  433. *
  434. * @see unorm_normalize
  435. * @see unorm_next
  436. * @see unorm_previous
  437. *
  438. * @stable ICU 2.1
  439. */
  440. U_STABLE int32_t U_EXPORT2
  441. unorm_concatenate(const UChar *left, int32_t leftLength,
  442. const UChar *right, int32_t rightLength,
  443. UChar *dest, int32_t destCapacity,
  444. UNormalizationMode mode, int32_t options,
  445. UErrorCode *pErrorCode);
  446. /**
  447. * Option bit for unorm_compare:
  448. * Both input strings are assumed to fulfill FCD conditions.
  449. * @stable ICU 2.2
  450. */
  451. #define UNORM_INPUT_IS_FCD 0x20000
  452. /**
  453. * Option bit for unorm_compare:
  454. * Perform case-insensitive comparison.
  455. * @stable ICU 2.2
  456. */
  457. #define U_COMPARE_IGNORE_CASE 0x10000
  458. #ifndef U_COMPARE_CODE_POINT_ORDER
  459. /* see also unistr.h and ustring.h */
  460. /**
  461. * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc:
  462. * Compare strings in code point order instead of code unit order.
  463. * @stable ICU 2.2
  464. */
  465. #define U_COMPARE_CODE_POINT_ORDER 0x8000
  466. #endif
  467. /**
  468. * Compare two strings for canonical equivalence.
  469. * Further options include case-insensitive comparison and
  470. * code point order (as opposed to code unit order).
  471. *
  472. * Canonical equivalence between two strings is defined as their normalized
  473. * forms (NFD or NFC) being identical.
  474. * This function compares strings incrementally instead of normalizing
  475. * (and optionally case-folding) both strings entirely,
  476. * improving performance significantly.
  477. *
  478. * Bulk normalization is only necessary if the strings do not fulfill the FCD
  479. * conditions. Only in this case, and only if the strings are relatively long,
  480. * is memory allocated temporarily.
  481. * For FCD strings and short non-FCD strings there is no memory allocation.
  482. *
  483. * Semantically, this is equivalent to
  484. * strcmp[CodePointOrder](NFD(foldCase(NFD(s1))), NFD(foldCase(NFD(s2))))
  485. * where code point order and foldCase are all optional.
  486. *
  487. * UAX 21 2.5 Caseless Matching specifies that for a canonical caseless match
  488. * the case folding must be performed first, then the normalization.
  489. *
  490. * @param s1 First source string.
  491. * @param length1 Length of first source string, or -1 if NUL-terminated.
  492. *
  493. * @param s2 Second source string.
  494. * @param length2 Length of second source string, or -1 if NUL-terminated.
  495. *
  496. * @param options A bit set of options:
  497. * - U_FOLD_CASE_DEFAULT or 0 is used for default options:
  498. * Case-sensitive comparison in code unit order, and the input strings
  499. * are quick-checked for FCD.
  500. *
  501. * - UNORM_INPUT_IS_FCD
  502. * Set if the caller knows that both s1 and s2 fulfill the FCD conditions.
  503. * If not set, the function will quickCheck for FCD
  504. * and normalize if necessary.
  505. *
  506. * - U_COMPARE_CODE_POINT_ORDER
  507. * Set to choose code point order instead of code unit order
  508. * (see u_strCompare for details).
  509. *
  510. * - U_COMPARE_IGNORE_CASE
  511. * Set to compare strings case-insensitively using case folding,
  512. * instead of case-sensitively.
  513. * If set, then the following case folding options are used.
  514. *
  515. * - Options as used with case-insensitive comparisons, currently:
  516. *
  517. * - U_FOLD_CASE_EXCLUDE_SPECIAL_I
  518. * (see u_strCaseCompare for details)
  519. *
  520. * - regular normalization options shifted left by UNORM_COMPARE_NORM_OPTIONS_SHIFT
  521. *
  522. * @param pErrorCode ICU error code in/out parameter.
  523. * Must fulfill U_SUCCESS before the function call.
  524. * @return <0 or 0 or >0 as usual for string comparisons
  525. *
  526. * @see unorm_normalize
  527. * @see UNORM_FCD
  528. * @see u_strCompare
  529. * @see u_strCaseCompare
  530. *
  531. * @stable ICU 2.2
  532. */
  533. U_STABLE int32_t U_EXPORT2
  534. unorm_compare(const UChar *s1, int32_t length1,
  535. const UChar *s2, int32_t length2,
  536. uint32_t options,
  537. UErrorCode *pErrorCode);
  538. #endif /* #if !UCONFIG_NO_NORMALIZATION */
  539. #endif