From 520264ec8c377f34a6b9bf19eb86c118fabe2670 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Sat, 4 Aug 2012 17:24:45 +0000 Subject: [PATCH] ICU-9406 deprecate UCOL_HIRAGANA_QUATERNARY_MODE, disable setter X-SVN-Rev: 32108 --- icu4c/source/i18n/ucol.cpp | 14 ++++------ icu4c/source/i18n/unicode/ucol.h | 47 +++++++++++++++++++++++++------- 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/icu4c/source/i18n/ucol.cpp b/icu4c/source/i18n/ucol.cpp index 13993e857f7..608524228d7 100644 --- a/icu4c/source/i18n/ucol.cpp +++ b/icu4c/source/i18n/ucol.cpp @@ -6566,15 +6566,11 @@ ucol_setAttribute(UCollator *coll, UColAttribute attr, UColAttributeValue value, } break; case UCOL_HIRAGANA_QUATERNARY_MODE: /* special quaternary values for Hiragana */ - if(value == UCOL_ON) { - coll->hiraganaQ = UCOL_ON; - coll->hiraganaQisDefault = FALSE; - } else if (value == UCOL_OFF) { - coll->hiraganaQ = UCOL_OFF; - coll->hiraganaQisDefault = FALSE; - } else if (value == UCOL_DEFAULT) { - coll->hiraganaQisDefault = TRUE; - coll->hiraganaQ = (UColAttributeValue)coll->options->hiraganaQ; + if(value == UCOL_ON || value == UCOL_OFF || value == UCOL_DEFAULT) { + // This attribute is an implementation detail of the CLDR Japanese tailoring. + // The implementation might change to use a different mechanism + // to achieve the same Japanese sort order. + // Since ICU 50, this attribute is not settable any more via API functions. } else { *status = U_ILLEGAL_ARGUMENT_ERROR; } diff --git a/icu4c/source/i18n/unicode/ucol.h b/icu4c/source/i18n/unicode/ucol.h index 1b60a11484c..3a06b76aaf4 100644 --- a/icu4c/source/i18n/unicode/ucol.h +++ b/icu4c/source/i18n/unicode/ucol.h @@ -238,10 +238,12 @@ typedef UColAttributeValue UCollationStrength; * @stable ICU 2.0 */ typedef enum { - /** Attribute for direction of secondary weights - used in French. + /** Attribute for direction of secondary weights - used in Canadian French. * Acceptable values are UCOL_ON, which results in secondary weights * being considered backwards and UCOL_OFF which treats secondary - * weights in the order they appear.*/ + * weights in the order they appear. + * @stable ICU 2.0 + */ UCOL_FRENCH_COLLATION, /** Attribute for handling variable elements. * Acceptable values are UCOL_NON_IGNORABLE (default) @@ -250,14 +252,18 @@ typedef enum { * and UCOL_SHIFTED which causes codepoints with primary * weights that are equal or below the variable top value * to be ignored on primary level and moved to the quaternary - * level.*/ + * level. + * @stable ICU 2.0 + */ UCOL_ALTERNATE_HANDLING, /** Controls the ordering of upper and lower case letters. * Acceptable values are UCOL_OFF (default), which orders * upper and lower case letters in accordance to their tertiary * weights, UCOL_UPPER_FIRST which forces upper case letters to * sort before lower case letters, and UCOL_LOWER_FIRST which does - * the opposite. */ + * the opposite. + * @stable ICU 2.0 + */ UCOL_CASE_FIRST, /** Controls whether an extra case level (positioned before the third * level) is generated or not. Acceptable values are UCOL_OFF (default), @@ -265,7 +271,9 @@ typedef enum { * level to be generated. Contents of the case level are affected by * the value of UCOL_CASE_FIRST attribute. A simple way to ignore * accent differences in a string is to set the strength to UCOL_PRIMARY - * and enable case level. */ + * and enable case level. + * @stable ICU 2.0 + */ UCOL_CASE_LEVEL, /** Controls whether the normalization check and necessary normalizations * are performed. When set to UCOL_OFF (default) no normalization check @@ -273,9 +281,13 @@ typedef enum { * input data is in so-called FCD form (see users manual for more info). * When set to UCOL_ON, an incremental check is performed to see whether * the input data is in the FCD form. If the data is not in the FCD form, - * incremental NFD normalization is performed. */ + * incremental NFD normalization is performed. + * @stable ICU 2.0 + */ UCOL_NORMALIZATION_MODE, - /** An alias for UCOL_NORMALIZATION_MODE attribute */ + /** An alias for UCOL_NORMALIZATION_MODE attribute. + * @stable ICU 2.0 + */ UCOL_DECOMPOSITION_MODE = UCOL_NORMALIZATION_MODE, /** The strength attribute. Can be either UCOL_PRIMARY, UCOL_SECONDARY, * UCOL_TERTIARY, UCOL_QUATERNARY or UCOL_IDENTICAL. The usual strength @@ -286,11 +298,20 @@ typedef enum { * UCOL_HIRAGANA_QUATERNARY mode to on. Otherwise, quaternary level * is affected only by the number of non ignorable code points in * the string. Identical strength is rarely useful, as it amounts - * to codepoints of the NFD form of the string. */ + * to codepoints of the NFD form of the string. + * @stable ICU 2.0 + */ UCOL_STRENGTH, /** When turned on, this attribute positions Hiragana before all * non-ignorables on quaternary level This is a sneaky way to produce JIS - * sort order */ + * sort order. + * + * This attribute is an implementation detail of the CLDR Japanese tailoring. + * The implementation might change to use a different mechanism + * to achieve the same Japanese sort order. + * Since ICU 50, this attribute is not settable any more via API functions. + * @deprecated ICU 50 Implementation detail, cannot be set via API, might be removed from implementation. + */ UCOL_HIRAGANA_QUATERNARY_MODE, /** When turned on, this attribute generates a collation key * for the numeric value of substrings of digits. @@ -298,8 +319,14 @@ typedef enum { * digit substring that can be treated as a single collation element is * 254 digits (not counting leading zeros). If a digit substring is * longer than that, the digits beyond the limit will be treated as a - * separate digit substring associated with a separate collation element. */ + * separate digit substring associated with a separate collation element. + * @stable ICU 2.8 + */ UCOL_NUMERIC_COLLATION, + /** + * The number of UColAttribute constants. + * @stable ICU 2.0 + */ UCOL_ATTRIBUTE_COUNT } UColAttribute;