1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 ********************************************************************
6 * Copyright (c) 1996-2015, International Business Machines Corporation and
7 * others. All Rights Reserved.
8 ********************************************************************
14 #include "unicode/utypes.h"
18 * \brief C++ API: Unicode Normalization
21 #if !UCONFIG_NO_NORMALIZATION
23 #include "unicode/chariter.h"
24 #include "unicode/normalizer2.h"
25 #include "unicode/unistr.h"
26 #include "unicode/unorm.h"
27 #include "unicode/uobject.h"
31 * Old Unicode normalization API.
33 * This API has been replaced by the Normalizer2 class and is only available
34 * for backward compatibility. This class simply delegates to the Normalizer2 class.
35 * There is one exception: The new API does not provide a replacement for Normalizer::compare().
37 * The Normalizer class supports the standard normalization forms described in
38 * <a href="http://www.unicode.org/unicode/reports/tr15/" target="unicode">
39 * Unicode Standard Annex #15: Unicode Normalization Forms</a>.
41 * The Normalizer class consists of two parts:
42 * - static functions that normalize strings or test if strings are normalized
43 * - a Normalizer object is an iterator that takes any kind of text and
44 * provides iteration over its normalized form
46 * The Normalizer class is not suitable for subclassing.
48 * For basic information about normalization forms and details about the C API
49 * please see the documentation in unorm.h.
51 * The iterator API with the Normalizer constructors and the non-static functions
52 * use a CharacterIterator as input. It is possible to pass a string which
53 * is then internally wrapped in a CharacterIterator.
54 * The input text is not normalized all at once, but incrementally where needed
55 * (providing efficient random access).
56 * This allows to pass in a large text but spend only a small amount of time
57 * normalizing a small part of that text.
58 * However, if the entire text is normalized, then the iterator will be
59 * slower than normalizing the entire text at once and iterating over the result.
60 * A possible use of the Normalizer iterator is also to report an index into the
61 * original text that is close to where the normalized characters come from.
63 * <em>Important:</em> The iterator API was cleaned up significantly for ICU 2.0.
64 * The earlier implementation reported the getIndex() inconsistently,
65 * and previous() could not be used after setIndex(), next(), first(), and current().
67 * Normalizer allows to start normalizing from anywhere in the input text by
68 * calling setIndexOnly(), first(), or last().
69 * Without calling any of these, the iterator will start at the beginning of the text.
71 * At any time, next() returns the next normalized code point (UChar32),
72 * with post-increment semantics (like CharacterIterator::next32PostInc()).
73 * previous() returns the previous normalized code point (UChar32),
74 * with pre-decrement semantics (like CharacterIterator::previous32()).
76 * current() returns the current code point
77 * (respectively the one at the newly set index) without moving
78 * the getIndex(). Note that if the text at the current position
79 * needs to be normalized, then these functions will do that.
80 * (This is why current() is not const.)
81 * It is more efficient to call setIndexOnly() instead, which does not
84 * getIndex() always refers to the position in the input text where the normalized
85 * code points are returned from. It does not always change with each returned
87 * The code point that is returned from any of the functions
88 * corresponds to text at or after getIndex(), according to the
89 * function's iteration semantics (post-increment or pre-decrement).
91 * next() returns a code point from at or after the getIndex()
92 * from before the next() call. After the next() call, the getIndex()
93 * might have moved to where the next code point will be returned from
94 * (from a next() or current() call).
95 * This is semantically equivalent to array access with array[index++]
96 * (post-increment semantics).
98 * previous() returns a code point from at or after the getIndex()
99 * from after the previous() call.
100 * This is semantically equivalent to array access with array[--index]
101 * (pre-decrement semantics).
103 * Internally, the Normalizer iterator normalizes a small piece of text
104 * starting at the getIndex() and ending at a following "safe" index.
105 * The normalized results is stored in an internal string buffer, and
106 * the code points are iterated from there.
107 * With multiple iteration calls, this is repeated until the next piece
108 * of text needs to be normalized, and the getIndex() needs to be moved.
110 * The following "safe" index, the internal buffer, and the secondary
111 * iteration index into that buffer are not exposed on the API.
112 * This also means that it is currently not practical to return to
113 * a particular, arbitrary position in the text because one would need to
114 * know, and be able to set, in addition to the getIndex(), at least also the
115 * current index into the internal buffer.
116 * It is currently only possible to observe when getIndex() changes
117 * (with careful consideration of the iteration semantics),
118 * at which time the internal index will be 0.
119 * For example, if getIndex() is different after next() than before it,
120 * then the internal index is 0 and one can return to this getIndex()
121 * later with setIndexOnly().
123 * Note: While the setIndex() and getIndex() refer to indices in the
124 * underlying Unicode input text, the next() and previous() methods
125 * iterate through characters in the normalized output.
126 * This means that there is not necessarily a one-to-one correspondence
127 * between characters returned by next() and previous() and the indices
128 * passed to and returned from setIndex() and getIndex().
129 * It is for this reason that Normalizer does not implement the CharacterIterator interface.
131 * @author Laura Werner, Mark Davis, Markus Scherer
134 class U_COMMON_API Normalizer : public UObject {
136 #ifndef U_HIDE_DEPRECATED_API
138 * If DONE is returned from an iteration function that returns a code point,
139 * then there are no more normalization results available.
140 * @deprecated ICU 56 Use Normalizer2 instead.
149 * Creates a new <code>Normalizer</code> object for iterating over the
150 * normalized form of a given string.
152 * @param str The string to be normalized. The normalization
153 * will start at the beginning of the string.
155 * @param mode The normalization mode.
156 * @deprecated ICU 56 Use Normalizer2 instead.
158 Normalizer(const UnicodeString& str, UNormalizationMode mode);
161 * Creates a new <code>Normalizer</code> object for iterating over the
162 * normalized form of a given string.
164 * @param str The string to be normalized. The normalization
165 * will start at the beginning of the string.
167 * @param length Length of the string, or -1 if NUL-terminated.
168 * @param mode The normalization mode.
169 * @deprecated ICU 56 Use Normalizer2 instead.
171 Normalizer(const UChar* str, int32_t length, UNormalizationMode mode);
174 * Creates a new <code>Normalizer</code> object for iterating over the
175 * normalized form of the given text.
177 * @param iter The input text to be normalized. The normalization
178 * will start at the beginning of the string.
180 * @param mode The normalization mode.
181 * @deprecated ICU 56 Use Normalizer2 instead.
183 Normalizer(const CharacterIterator& iter, UNormalizationMode mode);
184 #endif /* U_HIDE_DEPRECATED_API */
188 * @param copy The object to be copied.
189 * @deprecated ICU 56 Use Normalizer2 instead.
191 Normalizer(const Normalizer& copy);
195 * @deprecated ICU 56 Use Normalizer2 instead.
197 virtual ~Normalizer();
200 //-------------------------------------------------------------------------
201 // Static utility methods
202 //-------------------------------------------------------------------------
204 #ifndef U_HIDE_DEPRECATED_API
206 * Normalizes a <code>UnicodeString</code> according to the specified normalization mode.
207 * This is a wrapper for unorm_normalize(), using UnicodeString's.
209 * The <code>options</code> parameter specifies which optional
210 * <code>Normalizer</code> features are to be enabled for this operation.
212 * @param source the input string to be normalized.
213 * @param mode the normalization mode
214 * @param options the optional features to be enabled (0 for no options)
215 * @param result The normalized string (on output).
216 * @param status The error code.
217 * @deprecated ICU 56 Use Normalizer2 instead.
219 static void U_EXPORT2 normalize(const UnicodeString& source,
220 UNormalizationMode mode, int32_t options,
221 UnicodeString& result,
225 * Compose a <code>UnicodeString</code>.
226 * This is equivalent to normalize() with mode UNORM_NFC or UNORM_NFKC.
227 * This is a wrapper for unorm_normalize(), using UnicodeString's.
229 * The <code>options</code> parameter specifies which optional
230 * <code>Normalizer</code> features are to be enabled for this operation.
232 * @param source the string to be composed.
233 * @param compat Perform compatibility decomposition before composition.
234 * If this argument is <code>FALSE</code>, only canonical
235 * decomposition will be performed.
236 * @param options the optional features to be enabled (0 for no options)
237 * @param result The composed string (on output).
238 * @param status The error code.
239 * @deprecated ICU 56 Use Normalizer2 instead.
241 static void U_EXPORT2 compose(const UnicodeString& source,
242 UBool compat, int32_t options,
243 UnicodeString& result,
247 * Static method to decompose a <code>UnicodeString</code>.
248 * This is equivalent to normalize() with mode UNORM_NFD or UNORM_NFKD.
249 * This is a wrapper for unorm_normalize(), using UnicodeString's.
251 * The <code>options</code> parameter specifies which optional
252 * <code>Normalizer</code> features are to be enabled for this operation.
254 * @param source the string to be decomposed.
255 * @param compat Perform compatibility decomposition.
256 * If this argument is <code>FALSE</code>, only canonical
257 * decomposition will be performed.
258 * @param options the optional features to be enabled (0 for no options)
259 * @param result The decomposed string (on output).
260 * @param status The error code.
261 * @deprecated ICU 56 Use Normalizer2 instead.
263 static void U_EXPORT2 decompose(const UnicodeString& source,
264 UBool compat, int32_t options,
265 UnicodeString& result,
269 * Performing quick check on a string, to quickly determine if the string is
270 * in a particular normalization format.
271 * This is a wrapper for unorm_quickCheck(), using a UnicodeString.
273 * Three types of result can be returned UNORM_YES, UNORM_NO or
274 * UNORM_MAYBE. Result UNORM_YES indicates that the argument
275 * string is in the desired normalized format, UNORM_NO determines that
276 * argument string is not in the desired normalized format. A
277 * UNORM_MAYBE result indicates that a more thorough check is required,
278 * the user may have to put the string in its normalized form and compare the
280 * @param source string for determining if it is in a normalized format
281 * @param mode normalization format
282 * @param status A reference to a UErrorCode to receive any errors
283 * @return UNORM_YES, UNORM_NO or UNORM_MAYBE
286 * @deprecated ICU 56 Use Normalizer2 instead.
288 static inline UNormalizationCheckResult
289 quickCheck(const UnicodeString &source, UNormalizationMode mode, UErrorCode &status);
292 * Performing quick check on a string; same as the other version of quickCheck
293 * but takes an extra options parameter like most normalization functions.
295 * @param source string for determining if it is in a normalized format
296 * @param mode normalization format
297 * @param options the optional features to be enabled (0 for no options)
298 * @param status A reference to a UErrorCode to receive any errors
299 * @return UNORM_YES, UNORM_NO or UNORM_MAYBE
302 * @deprecated ICU 56 Use Normalizer2 instead.
304 static UNormalizationCheckResult
305 quickCheck(const UnicodeString &source, UNormalizationMode mode, int32_t options, UErrorCode &status);
308 * Test if a string is in a given normalization form.
309 * This is semantically equivalent to source.equals(normalize(source, mode)) .
311 * Unlike unorm_quickCheck(), this function returns a definitive result,
313 * For NFD, NFKD, and FCD, both functions work exactly the same.
314 * For NFC and NFKC where quickCheck may return "maybe", this function will
315 * perform further tests to arrive at a TRUE/FALSE result.
317 * @param src String that is to be tested if it is in a normalization format.
318 * @param mode Which normalization form to test for.
319 * @param errorCode ICU error code in/out parameter.
320 * Must fulfill U_SUCCESS before the function call.
321 * @return Boolean value indicating whether the source string is in the
322 * "mode" normalization form.
325 * @deprecated ICU 56 Use Normalizer2 instead.
328 isNormalized(const UnicodeString &src, UNormalizationMode mode, UErrorCode &errorCode);
331 * Test if a string is in a given normalization form; same as the other version of isNormalized
332 * but takes an extra options parameter like most normalization functions.
334 * @param src String that is to be tested if it is in a normalization format.
335 * @param mode Which normalization form to test for.
336 * @param options the optional features to be enabled (0 for no options)
337 * @param errorCode ICU error code in/out parameter.
338 * Must fulfill U_SUCCESS before the function call.
339 * @return Boolean value indicating whether the source string is in the
340 * "mode" normalization form.
343 * @deprecated ICU 56 Use Normalizer2 instead.
346 isNormalized(const UnicodeString &src, UNormalizationMode mode, int32_t options, UErrorCode &errorCode);
349 * Concatenate normalized strings, making sure that the result is normalized as well.
351 * If both the left and the right strings are in
352 * the normalization form according to "mode/options",
353 * then the result will be
356 * dest=normalize(left+right, mode, options)
359 * For details see unorm_concatenate in unorm.h.
361 * @param left Left source string.
362 * @param right Right source string.
363 * @param result The output string.
364 * @param mode The normalization mode.
365 * @param options A bit set of normalization options.
366 * @param errorCode ICU error code in/out parameter.
367 * Must fulfill U_SUCCESS before the function call.
370 * @see unorm_concatenate
373 * @see unorm_previous
375 * @deprecated ICU 56 Use Normalizer2 instead.
377 static UnicodeString &
378 U_EXPORT2 concatenate(const UnicodeString &left, const UnicodeString &right,
379 UnicodeString &result,
380 UNormalizationMode mode, int32_t options,
381 UErrorCode &errorCode);
382 #endif /* U_HIDE_DEPRECATED_API */
385 * Compare two strings for canonical equivalence.
386 * Further options include case-insensitive comparison and
387 * code point order (as opposed to code unit order).
389 * Canonical equivalence between two strings is defined as their normalized
390 * forms (NFD or NFC) being identical.
391 * This function compares strings incrementally instead of normalizing
392 * (and optionally case-folding) both strings entirely,
393 * improving performance significantly.
395 * Bulk normalization is only necessary if the strings do not fulfill the FCD
396 * conditions. Only in this case, and only if the strings are relatively long,
397 * is memory allocated temporarily.
398 * For FCD strings and short non-FCD strings there is no memory allocation.
400 * Semantically, this is equivalent to
401 * strcmp[CodePointOrder](NFD(foldCase(s1)), NFD(foldCase(s2)))
402 * where code point order and foldCase are all optional.
404 * UAX 21 2.5 Caseless Matching specifies that for a canonical caseless match
405 * the case folding must be performed first, then the normalization.
407 * @param s1 First source string.
408 * @param s2 Second source string.
410 * @param options A bit set of options:
411 * - U_FOLD_CASE_DEFAULT or 0 is used for default options:
412 * Case-sensitive comparison in code unit order, and the input strings
413 * are quick-checked for FCD.
415 * - UNORM_INPUT_IS_FCD
416 * Set if the caller knows that both s1 and s2 fulfill the FCD conditions.
417 * If not set, the function will quickCheck for FCD
418 * and normalize if necessary.
420 * - U_COMPARE_CODE_POINT_ORDER
421 * Set to choose code point order instead of code unit order
422 * (see u_strCompare for details).
424 * - U_COMPARE_IGNORE_CASE
425 * Set to compare strings case-insensitively using case folding,
426 * instead of case-sensitively.
427 * If set, then the following case folding options are used.
429 * - Options as used with case-insensitive comparisons, currently:
431 * - U_FOLD_CASE_EXCLUDE_SPECIAL_I
432 * (see u_strCaseCompare for details)
434 * - regular normalization options shifted left by UNORM_COMPARE_NORM_OPTIONS_SHIFT
436 * @param errorCode ICU error code in/out parameter.
437 * Must fulfill U_SUCCESS before the function call.
438 * @return <0 or 0 or >0 as usual for string comparisons
444 * @see u_strCaseCompare
448 static inline int32_t
449 compare(const UnicodeString &s1, const UnicodeString &s2,
451 UErrorCode &errorCode);
453 #ifndef U_HIDE_DEPRECATED_API
454 //-------------------------------------------------------------------------
456 //-------------------------------------------------------------------------
459 * Return the current character in the normalized text.
460 * current() may need to normalize some text at getIndex().
461 * The getIndex() is not changed.
463 * @return the current normalized code point
464 * @deprecated ICU 56 Use Normalizer2 instead.
466 UChar32 current(void);
469 * Return the first character in the normalized text.
470 * This is equivalent to setIndexOnly(startIndex()) followed by next().
471 * (Post-increment semantics.)
473 * @return the first normalized code point
474 * @deprecated ICU 56 Use Normalizer2 instead.
479 * Return the last character in the normalized text.
480 * This is equivalent to setIndexOnly(endIndex()) followed by previous().
481 * (Pre-decrement semantics.)
483 * @return the last normalized code point
484 * @deprecated ICU 56 Use Normalizer2 instead.
489 * Return the next character in the normalized text.
490 * (Post-increment semantics.)
491 * If the end of the text has already been reached, DONE is returned.
492 * The DONE value could be confused with a U+FFFF non-character code point
493 * in the text. If this is possible, you can test getIndex()<endIndex()
494 * before calling next(), or (getIndex()<endIndex() || last()!=DONE)
495 * after calling next(). (Calling last() will change the iterator state!)
497 * The C API unorm_next() is more efficient and does not have this ambiguity.
499 * @return the next normalized code point
500 * @deprecated ICU 56 Use Normalizer2 instead.
505 * Return the previous character in the normalized text and decrement.
506 * (Pre-decrement semantics.)
507 * If the beginning of the text has already been reached, DONE is returned.
508 * The DONE value could be confused with a U+FFFF non-character code point
509 * in the text. If this is possible, you can test
510 * (getIndex()>startIndex() || first()!=DONE). (Calling first() will change
511 * the iterator state!)
513 * The C API unorm_previous() is more efficient and does not have this ambiguity.
515 * @return the previous normalized code point
516 * @deprecated ICU 56 Use Normalizer2 instead.
518 UChar32 previous(void);
521 * Set the iteration position in the input text that is being normalized,
522 * without any immediate normalization.
523 * After setIndexOnly(), getIndex() will return the same index that is
526 * @param index the desired index in the input text.
527 * @deprecated ICU 56 Use Normalizer2 instead.
529 void setIndexOnly(int32_t index);
532 * Reset the index to the beginning of the text.
533 * This is equivalent to setIndexOnly(startIndex)).
534 * @deprecated ICU 56 Use Normalizer2 instead.
539 * Retrieve the current iteration position in the input text that is
542 * A following call to next() will return a normalized code point from
543 * the input text at or after this index.
545 * After a call to previous(), getIndex() will point at or before the
546 * position in the input text where the normalized code point
547 * was returned from with previous().
549 * @return the current index in the input text
550 * @deprecated ICU 56 Use Normalizer2 instead.
552 int32_t getIndex(void) const;
555 * Retrieve the index of the start of the input text. This is the begin index
556 * of the <code>CharacterIterator</code> or the start (i.e. index 0) of the string
557 * over which this <code>Normalizer</code> is iterating.
559 * @return the smallest index in the input text where the Normalizer operates
560 * @deprecated ICU 56 Use Normalizer2 instead.
562 int32_t startIndex(void) const;
565 * Retrieve the index of the end of the input text. This is the end index
566 * of the <code>CharacterIterator</code> or the length of the string
567 * over which this <code>Normalizer</code> is iterating.
568 * This end index is exclusive, i.e., the Normalizer operates only on characters
571 * @return the first index in the input text where the Normalizer does not operate
572 * @deprecated ICU 56 Use Normalizer2 instead.
574 int32_t endIndex(void) const;
577 * Returns TRUE when both iterators refer to the same character in the same
580 * @param that a Normalizer object to compare this one to
581 * @return comparison result
582 * @deprecated ICU 56 Use Normalizer2 instead.
584 UBool operator==(const Normalizer& that) const;
587 * Returns FALSE when both iterators refer to the same character in the same
590 * @param that a Normalizer object to compare this one to
591 * @return comparison result
592 * @deprecated ICU 56 Use Normalizer2 instead.
594 inline UBool operator!=(const Normalizer& that) const;
597 * Returns a pointer to a new Normalizer that is a clone of this one.
598 * The caller is responsible for deleting the new clone.
599 * @return a pointer to a new Normalizer
600 * @deprecated ICU 56 Use Normalizer2 instead.
602 Normalizer* clone(void) const;
605 * Generates a hash code for this iterator.
607 * @return the hash code
608 * @deprecated ICU 56 Use Normalizer2 instead.
610 int32_t hashCode(void) const;
612 //-------------------------------------------------------------------------
613 // Property access methods
614 //-------------------------------------------------------------------------
617 * Set the normalization mode for this object.
619 * <b>Note:</b>If the normalization mode is changed while iterating
620 * over a string, calls to {@link #next() } and {@link #previous() } may
621 * return previously buffers characters in the old normalization mode
622 * until the iteration is able to re-sync at the next base character.
623 * It is safest to call {@link #setIndexOnly }, {@link #reset() },
624 * {@link #setText }, {@link #first() },
625 * {@link #last() }, etc. after calling <code>setMode</code>.
627 * @param newMode the new mode for this <code>Normalizer</code>.
629 * @deprecated ICU 56 Use Normalizer2 instead.
631 void setMode(UNormalizationMode newMode);
634 * Return the normalization mode for this object.
636 * This is an unusual name because there used to be a getMode() that
637 * returned a different type.
639 * @return the mode for this <code>Normalizer</code>
641 * @deprecated ICU 56 Use Normalizer2 instead.
643 UNormalizationMode getUMode(void) const;
646 * Set options that affect this <code>Normalizer</code>'s operation.
647 * Options do not change the basic composition or decomposition operation
648 * that is being performed, but they control whether
649 * certain optional portions of the operation are done.
650 * Currently the only available option is obsolete.
652 * It is possible to specify multiple options that are all turned on or off.
654 * @param option the option(s) whose value is/are to be set.
655 * @param value the new setting for the option. Use <code>TRUE</code> to
656 * turn the option(s) on and <code>FALSE</code> to turn it/them off.
659 * @deprecated ICU 56 Use Normalizer2 instead.
661 void setOption(int32_t option,
665 * Determine whether an option is turned on or off.
666 * If multiple options are specified, then the result is TRUE if any
669 * @param option the option(s) that are to be checked
670 * @return TRUE if any of the option(s) are set
672 * @deprecated ICU 56 Use Normalizer2 instead.
674 UBool getOption(int32_t option) const;
677 * Set the input text over which this <code>Normalizer</code> will iterate.
678 * The iteration position is set to the beginning.
680 * @param newText a string that replaces the current input text
681 * @param status a UErrorCode
682 * @deprecated ICU 56 Use Normalizer2 instead.
684 void setText(const UnicodeString& newText,
688 * Set the input text over which this <code>Normalizer</code> will iterate.
689 * The iteration position is set to the beginning.
691 * @param newText a CharacterIterator object that replaces the current input text
692 * @param status a UErrorCode
693 * @deprecated ICU 56 Use Normalizer2 instead.
695 void setText(const CharacterIterator& newText,
699 * Set the input text over which this <code>Normalizer</code> will iterate.
700 * The iteration position is set to the beginning.
702 * @param newText a string that replaces the current input text
703 * @param length the length of the string, or -1 if NUL-terminated
704 * @param status a UErrorCode
705 * @deprecated ICU 56 Use Normalizer2 instead.
707 void setText(const UChar* newText,
711 * Copies the input text into the UnicodeString argument.
713 * @param result Receives a copy of the text under iteration.
714 * @deprecated ICU 56 Use Normalizer2 instead.
716 void getText(UnicodeString& result);
719 * ICU "poor man's RTTI", returns a UClassID for this class.
720 * @returns a UClassID for this class.
721 * @deprecated ICU 56 Use Normalizer2 instead.
723 static UClassID U_EXPORT2 getStaticClassID();
724 #endif /* U_HIDE_DEPRECATED_API */
727 * ICU "poor man's RTTI", returns a UClassID for the actual class.
728 * @return a UClassID for the actual class.
729 * @deprecated ICU 56 Use Normalizer2 instead.
731 virtual UClassID getDynamicClassID() const;
734 //-------------------------------------------------------------------------
736 //-------------------------------------------------------------------------
738 Normalizer(); // default constructor not implemented
739 Normalizer &operator=(const Normalizer &that); // assignment operator not implemented
741 // Private utility methods for iteration
742 // For documentation, see the source code
743 UBool nextNormalize();
744 UBool previousNormalize();
747 void clearBuffer(void);
749 //-------------------------------------------------------------------------
751 //-------------------------------------------------------------------------
753 FilteredNormalizer2*fFilteredNorm2; // owned if not NULL
754 const Normalizer2 *fNorm2; // not owned; may be equal to fFilteredNorm2
755 UNormalizationMode fUMode; // deprecated
758 // The input text and our position in it
759 CharacterIterator *text;
761 // The normalization buffer is the result of normalization
762 // of the source in [currentIndex..nextIndex[ .
763 int32_t currentIndex, nextIndex;
765 // A buffer for holding intermediate results
766 UnicodeString buffer;
770 //-------------------------------------------------------------------------
771 // Inline implementations
772 //-------------------------------------------------------------------------
774 #ifndef U_HIDE_DEPRECATED_API
776 Normalizer::operator!= (const Normalizer& other) const
777 { return ! operator==(other); }
779 inline UNormalizationCheckResult
780 Normalizer::quickCheck(const UnicodeString& source,
781 UNormalizationMode mode,
782 UErrorCode &status) {
783 return quickCheck(source, mode, 0, status);
787 Normalizer::isNormalized(const UnicodeString& source,
788 UNormalizationMode mode,
789 UErrorCode &status) {
790 return isNormalized(source, mode, 0, status);
792 #endif /* U_HIDE_DEPRECATED_API */
795 Normalizer::compare(const UnicodeString &s1, const UnicodeString &s2,
797 UErrorCode &errorCode) {
798 // all argument checking is done in unorm_compare
799 return unorm_compare(s1.getBuffer(), s1.length(),
800 s2.getBuffer(), s2.length(),
807 #endif /* #if !UCONFIG_NO_NORMALIZATION */