Issue #1971 - Part 2: Update ICU source to 63.2.

This commit is contained in:
Job Bautista 2022-07-24 21:03:27 +08:00 committed by roytam1
commit 1e69214382
3160 changed files with 275815 additions and 234203 deletions

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@ -26,6 +26,25 @@
#define UCHAR_H
#include "unicode/utypes.h"
#include "unicode/stringoptions.h"
#include "unicode/ucpmap.h"
#if !defined(USET_DEFINED) && !defined(U_IN_DOXYGEN)
#define USET_DEFINED
/**
* USet is the C API type corresponding to C++ class UnicodeSet.
* It is forward-declared here to avoid including unicode/uset.h file if related
* APIs are not used.
*
* @see ucnv_getUnicodeSet
* @stable ICU 2.4
*/
typedef struct USet USet;
#endif
U_CDECL_BEGIN
@ -41,7 +60,7 @@ U_CDECL_BEGIN
* @see u_getUnicodeVersion
* @stable ICU 2.0
*/
#define U_UNICODE_VERSION "9.0"
#define U_UNICODE_VERSION "11.0"
/**
* \file
@ -60,6 +79,18 @@ U_CDECL_BEGIN
* "About the Unicode Character Database" (http://www.unicode.org/ucd/)
* and the ICU User Guide chapter on Properties (http://icu-project.org/userguide/properties.html).
*
* Many properties are accessible via generic functions that take a UProperty selector.
* - u_hasBinaryProperty() returns a binary value (TRUE/FALSE) per property and code point.
* - u_getIntPropertyValue() returns an integer value per property and code point.
* For each supported enumerated or catalog property, there is
* an enum type for all of the property's values, and
* u_getIntPropertyValue() returns the numeric values of those constants.
* - u_getBinaryPropertySet() returns a set for each ICU-supported binary property with
* all code points for which the property is true.
* - u_getIntPropertyMap() returns a map for each
* ICU-supported enumerated/catalog/int-valued property which
* maps all Unicode code points to their values for that property.
*
* Many functions are designed to match java.lang.Character functions.
* See the individual function documentation,
* and see the JDK 1.4 java.lang.Character documentation
@ -111,11 +142,11 @@ U_CDECL_BEGIN
* Comparison:
* - u_isUWhiteSpace=UCHAR_WHITE_SPACE: Unicode White_Space property;
* most of general categories "Z" (separators) + most whitespace ISO controls
* (including no-break spaces, but excluding IS1..IS4 and ZWSP)
* (including no-break spaces, but excluding IS1..IS4)
* - u_isWhitespace: Java isWhitespace; Z + whitespace ISO controls but excluding no-break spaces
* - u_isJavaSpaceChar: Java isSpaceChar; just Z (including no-break spaces)
* - u_isspace: Z + whitespace ISO controls (including no-break spaces)
* - u_isblank: "horizontal spaces" = TAB + Zs - ZWSP
* - u_isblank: "horizontal spaces" = TAB + Zs
*/
/**
@ -148,8 +179,9 @@ U_CDECL_BEGIN
*
* The properties APIs are intended to reflect Unicode properties as defined
* in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR).
* For details about the properties see http://www.unicode.org/ucd/ .
* For names of Unicode properties see the UCD file PropertyAliases.txt.
*
* For details about the properties see
* UAX #44: Unicode Character Database (http://www.unicode.org/reports/tr44/).
*
* Important: If ICU is built with UCD files from Unicode versions below, e.g., 3.2,
* then properties marked with "new in Unicode 3.2" are not or not fully available.
@ -399,42 +431,64 @@ typedef enum UProperty {
UCHAR_CHANGES_WHEN_CASEMAPPED=55,
/** Binary property Changes_When_NFKC_Casefolded. @stable ICU 4.4 */
UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED=56,
#ifndef U_HIDE_DRAFT_API
/**
* Binary property Emoji.
* See http://www.unicode.org/reports/tr51/#Emoji_Properties
*
* @draft ICU 57
* @stable ICU 57
*/
UCHAR_EMOJI=57,
/**
* Binary property Emoji_Presentation.
* See http://www.unicode.org/reports/tr51/#Emoji_Properties
*
* @draft ICU 57
* @stable ICU 57
*/
UCHAR_EMOJI_PRESENTATION=58,
/**
* Binary property Emoji_Modifier.
* See http://www.unicode.org/reports/tr51/#Emoji_Properties
*
* @draft ICU 57
* @stable ICU 57
*/
UCHAR_EMOJI_MODIFIER=59,
/**
* Binary property Emoji_Modifier_Base.
* See http://www.unicode.org/reports/tr51/#Emoji_Properties
*
* @draft ICU 57
* @stable ICU 57
*/
UCHAR_EMOJI_MODIFIER_BASE=60,
#endif /* U_HIDE_DRAFT_API */
/**
* Binary property Emoji_Component.
* See http://www.unicode.org/reports/tr51/#Emoji_Properties
*
* @stable ICU 60
*/
UCHAR_EMOJI_COMPONENT=61,
/**
* Binary property Regional_Indicator.
* @stable ICU 60
*/
UCHAR_REGIONAL_INDICATOR=62,
/**
* Binary property Prepended_Concatenation_Mark.
* @stable ICU 60
*/
UCHAR_PREPENDED_CONCATENATION_MARK=63,
/**
* Binary property Extended_Pictographic.
* See http://www.unicode.org/reports/tr51/#Emoji_Properties
*
* @stable ICU 62
*/
UCHAR_EXTENDED_PICTOGRAPHIC=64,
#ifndef U_HIDE_DEPRECATED_API
/**
* One more than the last constant for binary Unicode properties.
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UCHAR_BINARY_LIMIT=61,
UCHAR_BINARY_LIMIT,
#endif // U_HIDE_DEPRECATED_API
/** Enumerated property Bidi_Class.
@ -522,12 +576,34 @@ typedef enum UProperty {
(http://www.unicode.org/reports/tr9/)
Returns UBidiPairedBracketType values. @stable ICU 52 */
UCHAR_BIDI_PAIRED_BRACKET_TYPE=0x1015,
/**
* Enumerated property Indic_Positional_Category.
* New in Unicode 6.0 as provisional property Indic_Matra_Category;
* renamed and changed to informative in Unicode 8.0.
* See http://www.unicode.org/reports/tr44/#IndicPositionalCategory.txt
* @stable ICU 63
*/
UCHAR_INDIC_POSITIONAL_CATEGORY=0x1016,
/**
* Enumerated property Indic_Syllabic_Category.
* New in Unicode 6.0 as provisional; informative since Unicode 8.0.
* See http://www.unicode.org/reports/tr44/#IndicSyllabicCategory.txt
* @stable ICU 63
*/
UCHAR_INDIC_SYLLABIC_CATEGORY=0x1017,
/**
* Enumerated property Vertical_Orientation.
* Used for UAX #50 Unicode Vertical Text Layout (https://www.unicode.org/reports/tr50/).
* New as a UCD property in Unicode 10.0.
* @stable ICU 63
*/
UCHAR_VERTICAL_ORIENTATION=0x1018,
#ifndef U_HIDE_DEPRECATED_API
/**
* One more than the last constant for enumerated/integer Unicode properties.
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UCHAR_INT_LIMIT=0x1016,
UCHAR_INT_LIMIT=0x1019,
#endif // U_HIDE_DEPRECATED_API
/** Bitmask property General_Category_Mask.
@ -1649,6 +1725,48 @@ enum UBlockCode {
/** @stable ICU 58 */
UBLOCK_TANGUT_COMPONENTS = 273, /*[18800]*/
// New blocks in Unicode 10.0
/** @stable ICU 60 */
UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F = 274, /*[2CEB0]*/
/** @stable ICU 60 */
UBLOCK_KANA_EXTENDED_A = 275, /*[1B100]*/
/** @stable ICU 60 */
UBLOCK_MASARAM_GONDI = 276, /*[11D00]*/
/** @stable ICU 60 */
UBLOCK_NUSHU = 277, /*[1B170]*/
/** @stable ICU 60 */
UBLOCK_SOYOMBO = 278, /*[11A50]*/
/** @stable ICU 60 */
UBLOCK_SYRIAC_SUPPLEMENT = 279, /*[0860]*/
/** @stable ICU 60 */
UBLOCK_ZANABAZAR_SQUARE = 280, /*[11A00]*/
// New blocks in Unicode 11.0
/** @stable ICU 62 */
UBLOCK_CHESS_SYMBOLS = 281, /*[1FA00]*/
/** @stable ICU 62 */
UBLOCK_DOGRA = 282, /*[11800]*/
/** @stable ICU 62 */
UBLOCK_GEORGIAN_EXTENDED = 283, /*[1C90]*/
/** @stable ICU 62 */
UBLOCK_GUNJALA_GONDI = 284, /*[11D60]*/
/** @stable ICU 62 */
UBLOCK_HANIFI_ROHINGYA = 285, /*[10D00]*/
/** @stable ICU 62 */
UBLOCK_INDIC_SIYAQ_NUMBERS = 286, /*[1EC70]*/
/** @stable ICU 62 */
UBLOCK_MAKASAR = 287, /*[11EE0]*/
/** @stable ICU 62 */
UBLOCK_MAYAN_NUMERALS = 288, /*[1D2E0]*/
/** @stable ICU 62 */
UBLOCK_MEDEFAIDRIN = 289, /*[16E40]*/
/** @stable ICU 62 */
UBLOCK_OLD_SOGDIAN = 290, /*[10F00]*/
/** @stable ICU 62 */
UBLOCK_SOGDIAN = 291, /*[10F30]*/
#ifndef U_HIDE_DEPRECATED_API
/**
* One more than the highest normal UBlockCode value.
@ -1656,7 +1774,7 @@ enum UBlockCode {
*
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UBLOCK_COUNT = 274,
UBLOCK_COUNT = 292,
#endif // U_HIDE_DEPRECATED_API
/** @stable ICU 2.0 */
@ -1932,6 +2050,22 @@ typedef enum UJoiningGroup {
U_JG_AFRICAN_FEH, /**< @stable ICU 58 */
U_JG_AFRICAN_NOON, /**< @stable ICU 58 */
U_JG_AFRICAN_QAF, /**< @stable ICU 58 */
U_JG_MALAYALAM_BHA, /**< @stable ICU 60 */
U_JG_MALAYALAM_JA, /**< @stable ICU 60 */
U_JG_MALAYALAM_LLA, /**< @stable ICU 60 */
U_JG_MALAYALAM_LLLA, /**< @stable ICU 60 */
U_JG_MALAYALAM_NGA, /**< @stable ICU 60 */
U_JG_MALAYALAM_NNA, /**< @stable ICU 60 */
U_JG_MALAYALAM_NNNA, /**< @stable ICU 60 */
U_JG_MALAYALAM_NYA, /**< @stable ICU 60 */
U_JG_MALAYALAM_RA, /**< @stable ICU 60 */
U_JG_MALAYALAM_SSA, /**< @stable ICU 60 */
U_JG_MALAYALAM_TTA, /**< @stable ICU 60 */
U_JG_HANIFI_ROHINGYA_KINNA_YA, /**< @stable ICU 62 */
U_JG_HANIFI_ROHINGYA_PA, /**< @stable ICU 62 */
#ifndef U_HIDE_DEPRECATED_API
/**
* One more than the highest normal UJoiningGroup value.
@ -1982,6 +2116,7 @@ typedef enum UGraphemeClusterBreak {
U_GCB_GLUE_AFTER_ZWJ = 16, /*[GAZ]*/
/** @stable ICU 58 */
U_GCB_ZWJ = 17, /*[ZWJ]*/
#ifndef U_HIDE_DEPRECATED_API
/**
* One more than the highest normal UGraphemeClusterBreak value.
@ -2043,6 +2178,9 @@ typedef enum UWordBreakValues {
U_WB_GLUE_AFTER_ZWJ = 20, /*[GAZ]*/
/** @stable ICU 58 */
U_WB_ZWJ = 21, /*[ZWJ]*/
/** @stable ICU 62 */
U_WB_WSEGSPACE = 22, /*[WSEGSPACE]*/
#ifndef U_HIDE_DEPRECATED_API
/**
* One more than the highest normal UWordBreakValues value.
@ -2050,7 +2188,7 @@ typedef enum UWordBreakValues {
*
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
U_WB_COUNT = 22
U_WB_COUNT = 23
#endif // U_HIDE_DEPRECATED_API
} UWordBreakValues;
@ -2234,6 +2372,161 @@ typedef enum UHangulSyllableType {
#endif // U_HIDE_DEPRECATED_API
} UHangulSyllableType;
/**
* Indic Positional Category constants.
*
* @see UCHAR_INDIC_POSITIONAL_CATEGORY
* @stable ICU 63
*/
typedef enum UIndicPositionalCategory {
/*
* Note: UIndicPositionalCategory constants are parsed by preparseucd.py.
* It matches lines like
* U_INPC_<Unicode Indic_Positional_Category value name>
*/
/** @stable ICU 63 */
U_INPC_NA,
/** @stable ICU 63 */
U_INPC_BOTTOM,
/** @stable ICU 63 */
U_INPC_BOTTOM_AND_LEFT,
/** @stable ICU 63 */
U_INPC_BOTTOM_AND_RIGHT,
/** @stable ICU 63 */
U_INPC_LEFT,
/** @stable ICU 63 */
U_INPC_LEFT_AND_RIGHT,
/** @stable ICU 63 */
U_INPC_OVERSTRUCK,
/** @stable ICU 63 */
U_INPC_RIGHT,
/** @stable ICU 63 */
U_INPC_TOP,
/** @stable ICU 63 */
U_INPC_TOP_AND_BOTTOM,
/** @stable ICU 63 */
U_INPC_TOP_AND_BOTTOM_AND_RIGHT,
/** @stable ICU 63 */
U_INPC_TOP_AND_LEFT,
/** @stable ICU 63 */
U_INPC_TOP_AND_LEFT_AND_RIGHT,
/** @stable ICU 63 */
U_INPC_TOP_AND_RIGHT,
/** @stable ICU 63 */
U_INPC_VISUAL_ORDER_LEFT,
} UIndicPositionalCategory;
/**
* Indic Syllabic Category constants.
*
* @see UCHAR_INDIC_SYLLABIC_CATEGORY
* @stable ICU 63
*/
typedef enum UIndicSyllabicCategory {
/*
* Note: UIndicSyllabicCategory constants are parsed by preparseucd.py.
* It matches lines like
* U_INSC_<Unicode Indic_Syllabic_Category value name>
*/
/** @stable ICU 63 */
U_INSC_OTHER,
/** @stable ICU 63 */
U_INSC_AVAGRAHA,
/** @stable ICU 63 */
U_INSC_BINDU,
/** @stable ICU 63 */
U_INSC_BRAHMI_JOINING_NUMBER,
/** @stable ICU 63 */
U_INSC_CANTILLATION_MARK,
/** @stable ICU 63 */
U_INSC_CONSONANT,
/** @stable ICU 63 */
U_INSC_CONSONANT_DEAD,
/** @stable ICU 63 */
U_INSC_CONSONANT_FINAL,
/** @stable ICU 63 */
U_INSC_CONSONANT_HEAD_LETTER,
/** @stable ICU 63 */
U_INSC_CONSONANT_INITIAL_POSTFIXED,
/** @stable ICU 63 */
U_INSC_CONSONANT_KILLER,
/** @stable ICU 63 */
U_INSC_CONSONANT_MEDIAL,
/** @stable ICU 63 */
U_INSC_CONSONANT_PLACEHOLDER,
/** @stable ICU 63 */
U_INSC_CONSONANT_PRECEDING_REPHA,
/** @stable ICU 63 */
U_INSC_CONSONANT_PREFIXED,
/** @stable ICU 63 */
U_INSC_CONSONANT_SUBJOINED,
/** @stable ICU 63 */
U_INSC_CONSONANT_SUCCEEDING_REPHA,
/** @stable ICU 63 */
U_INSC_CONSONANT_WITH_STACKER,
/** @stable ICU 63 */
U_INSC_GEMINATION_MARK,
/** @stable ICU 63 */
U_INSC_INVISIBLE_STACKER,
/** @stable ICU 63 */
U_INSC_JOINER,
/** @stable ICU 63 */
U_INSC_MODIFYING_LETTER,
/** @stable ICU 63 */
U_INSC_NON_JOINER,
/** @stable ICU 63 */
U_INSC_NUKTA,
/** @stable ICU 63 */
U_INSC_NUMBER,
/** @stable ICU 63 */
U_INSC_NUMBER_JOINER,
/** @stable ICU 63 */
U_INSC_PURE_KILLER,
/** @stable ICU 63 */
U_INSC_REGISTER_SHIFTER,
/** @stable ICU 63 */
U_INSC_SYLLABLE_MODIFIER,
/** @stable ICU 63 */
U_INSC_TONE_LETTER,
/** @stable ICU 63 */
U_INSC_TONE_MARK,
/** @stable ICU 63 */
U_INSC_VIRAMA,
/** @stable ICU 63 */
U_INSC_VISARGA,
/** @stable ICU 63 */
U_INSC_VOWEL,
/** @stable ICU 63 */
U_INSC_VOWEL_DEPENDENT,
/** @stable ICU 63 */
U_INSC_VOWEL_INDEPENDENT,
} UIndicSyllabicCategory;
/**
* Vertical Orientation constants.
*
* @see UCHAR_VERTICAL_ORIENTATION
* @stable ICU 63
*/
typedef enum UVerticalOrientation {
/*
* Note: UVerticalOrientation constants are parsed by preparseucd.py.
* It matches lines like
* U_VO_<Unicode Vertical_Orientation value name>
*/
/** @stable ICU 63 */
U_VO_ROTATED,
/** @stable ICU 63 */
U_VO_TRANSFORMED_ROTATED,
/** @stable ICU 63 */
U_VO_TRANSFORMED_UPRIGHT,
/** @stable ICU 63 */
U_VO_UPRIGHT,
} UVerticalOrientation;
/**
* Check a binary Unicode property for a code point.
*
@ -2256,6 +2549,7 @@ typedef enum UHangulSyllableType {
* does not have data for the property at all, or not for this code point.
*
* @see UProperty
* @see u_getBinaryPropertySet
* @see u_getIntPropertyValue
* @see u_getUnicodeVersion
* @stable ICU 2.1
@ -2263,6 +2557,28 @@ typedef enum UHangulSyllableType {
U_STABLE UBool U_EXPORT2
u_hasBinaryProperty(UChar32 c, UProperty which);
#ifndef U_HIDE_DRAFT_API
/**
* Returns a frozen USet for a binary property.
* The library retains ownership over the returned object.
* Sets an error code if the property number is not one for a binary property.
*
* The returned set contains all code points for which the property is true.
*
* @param property UCHAR_BINARY_START..UCHAR_BINARY_LIMIT-1
* @param pErrorCode an in/out ICU UErrorCode
* @return the property as a set
* @see UProperty
* @see u_hasBinaryProperty
* @see Unicode::fromUSet
* @draft ICU 63
*/
U_CAPI const USet * U_EXPORT2
u_getBinaryPropertySet(UProperty property, UErrorCode *pErrorCode);
#endif // U_HIDE_DRAFT_API
/**
* Check if a code point has the Alphabetic Unicode property.
* Same as u_hasBinaryProperty(c, UCHAR_ALPHABETIC).
@ -2363,6 +2679,7 @@ u_isUWhiteSpace(UChar32 c);
* @see u_hasBinaryProperty
* @see u_getIntPropertyMinValue
* @see u_getIntPropertyMaxValue
* @see u_getIntPropertyMap
* @see u_getUnicodeVersion
* @stable ICU 2.2
*/
@ -2419,6 +2736,28 @@ u_getIntPropertyMinValue(UProperty which);
U_STABLE int32_t U_EXPORT2
u_getIntPropertyMaxValue(UProperty which);
#ifndef U_HIDE_DRAFT_API
/**
* Returns an immutable UCPMap for an enumerated/catalog/int-valued property.
* The library retains ownership over the returned object.
* Sets an error code if the property number is not one for an "int property".
*
* The returned object maps all Unicode code points to their values for that property.
* For documentation of the integer values see u_getIntPropertyValue().
*
* @param property UCHAR_INT_START..UCHAR_INT_LIMIT-1
* @param pErrorCode an in/out ICU UErrorCode
* @return the property as a map
* @see UProperty
* @see u_getIntPropertyValue
* @draft ICU 63
*/
U_CAPI const UCPMap * U_EXPORT2
u_getIntPropertyMap(UProperty property, UErrorCode *pErrorCode);
#endif // U_HIDE_DRAFT_API
/**
* Get the numeric value for a Unicode code point as defined in the
* Unicode Character Database.
@ -2655,8 +2994,7 @@ u_isgraph(UChar32 c);
*
* same as
*
* TRUE for U+0009 (TAB) and characters with general category "Zs" (space separators)
* except Zero Width Space (ZWSP, U+200B).
* TRUE for U+0009 (TAB) and characters with general category "Zs" (space separators).
*
* Note: There are several ICU whitespace functions; please see the uchar.h
* file documentation for a detailed comparison.
@ -3523,27 +3861,6 @@ u_toupper(UChar32 c);
U_STABLE UChar32 U_EXPORT2
u_totitle(UChar32 c);
/** Option value for case folding: use default mappings defined in CaseFolding.txt. @stable ICU 2.0 */
#define U_FOLD_CASE_DEFAULT 0
/**
* Option value for case folding:
*
* Use the modified set of mappings provided in CaseFolding.txt to handle dotted I
* and dotless i appropriately for Turkic languages (tr, az).
*
* Before Unicode 3.2, CaseFolding.txt contains mappings marked with 'I' that
* are to be included for default mappings and
* excluded for the Turkic-specific mappings.
*
* Unicode 3.2 CaseFolding.txt instead contains mappings marked with 'T' that
* are to be excluded for default mappings and
* included for the Turkic-specific mappings.
*
* @stable ICU 2.0
*/
#define U_FOLD_CASE_EXCLUDE_SPECIAL_I 1
/**
* The given character is mapped to its case folding equivalent according to
* UnicodeData.txt and CaseFolding.txt;