/*
*******************************************************************************
-* Copyright (c) 1996-2004, International Business Machines Corporation
+* Copyright (c) 1996-2010, International Business Machines Corporation
* and others. All Rights Reserved.
*******************************************************************************
* File unorm.h
#if !UCONFIG_NO_NORMALIZATION
#include "unicode/uiter.h"
+#include "unicode/unorm2.h"
/**
* \file
*
* <h2>Unicode normalization API</h2>
*
+ * Note: This API has been replaced by the unorm2.h API and is only available
+ * for backward compatibility. The functions here simply delegate to the
+ * unorm2.h functions, for example unorm2_getInstance() and unorm2_normalize().
+ * There is one exception: The new API does not provide a replacement for unorm_compare().
+ *
* <code>unorm_normalize</code> transforms Unicode text into an equivalent composed or
* decomposed form, allowing for easier sorting and searching of text.
* <code>unorm_normalize</code> supports the standard normalization forms described in
* <a href="http://www.unicode.org/unicode/reports/tr15/" target="unicode">
- * Unicode Standard Annex #15 — Unicode Normalization Forms</a>.
+ * Unicode Standard Annex #15: Unicode Normalization Forms</a>.
*
* Characters with accents or other adornments can be encoded in
* several different ways in Unicode. For example, take the character A-acute.
* unorm_normalize(UNORM_FCD) may be implemented with UNORM_NFD.
*
* For more details on FCD see the collation design document:
- * http://oss.software.ibm.com/cvs/icu/~checkout~/icuhtml/design/collation/ICU_collation_design.htm
+ * http://source.icu-project.org/repos/icu/icuhtml/trunk/design/collation/ICU_collation_design.htm
*
* ICU collation performs either NFD or FCD normalization automatically if normalization
* is turned on for the collator object.
* Normalize a string.
* The string will be normalized according the specified normalization mode
* and options.
+ * The source and result buffers must not be the same, nor overlap.
*
* @param source The string to normalize.
* @param sourceLength The length of source, or -1 if NUL-terminated.
UNormalizationMode mode, int32_t options,
UChar *result, int32_t resultLength,
UErrorCode *status);
-#endif
-/**
- * Result values for unorm_quickCheck().
- * For details see Unicode Technical Report 15.
- * @stable ICU 2.0
- */
-typedef enum UNormalizationCheckResult {
- /**
- * Indicates that string is not in the normalized format
- */
- UNORM_NO,
- /**
- * Indicates that string is in the normalized format
- */
- UNORM_YES,
- /**
- * Indicates that string cannot be determined if it is in the normalized
- * format without further thorough checks.
- */
- UNORM_MAYBE
-} UNormalizationCheckResult;
-#if !UCONFIG_NO_NORMALIZATION
+
/**
* Performing quick check on a string, to quickly determine if the string is
* in a particular normalization format.
*
* @param left Left source string, may be same as dest.
* @param leftLength Length of left source string, or -1 if NUL-terminated.
- * @param right Right source string.
+ * @param right Right source string. Must not be the same as dest, nor overlap.
* @param rightLength Length of right source string, or -1 if NUL-terminated.
* @param dest The output buffer; can be NULL if destCapacity==0 for pure preflighting.
* @param destCapacity The number of UChars that fit into dest.