1 /* 2 ********************************************************************** 3 * Copyright (C) 1997-2009, International Business Machines 4 * Corporation and others. All Rights Reserved. 5 ********************************************************************** 6 * 7 * File UCHAR.H 8 * 9 * Modification History: 10 * 11 * Date Name Description 12 * 04/02/97 aliu Creation. 13 * 03/29/99 helena Updated for C APIs. 14 * 4/15/99 Madhu Updated for C Implementation and Javadoc 15 * 5/20/99 Madhu Added the function u_getVersion() 16 * 8/19/1999 srl Upgraded scripts to Unicode 3.0 17 * 8/27/1999 schererm UCharDirection constants: U_... 18 * 11/11/1999 weiv added u_isalnum(), cleaned comments 19 * 01/11/2000 helena Renamed u_getVersion to u_getUnicodeVersion(). 20 ****************************************************************************** 21 */ 22 23 #ifndef UCHAR_H 24 #define UCHAR_H 25 26 #include "unicode/utypes.h" 27 28 U_CDECL_BEGIN 29 30 /*==========================================================================*/ 31 /* Unicode version number */ 32 /*==========================================================================*/ 33 /** 34 * Unicode version number, default for the current ICU version. 35 * The actual Unicode Character Database (UCD) data is stored in uprops.dat 36 * and may be generated from UCD files from a different Unicode version. 37 * Call u_getUnicodeVersion to get the actual Unicode version of the data. 38 * 39 * @see u_getUnicodeVersion 40 * @stable ICU 2.0 41 */ 42 #define U_UNICODE_VERSION "5.1" 43 44 /** 45 * \file 46 * \brief C API: Unicode Properties 47 * 48 * This C API provides low-level access to the Unicode Character Database. 49 * In addition to raw property values, some convenience functions calculate 50 * derived properties, for example for Java-style programming. 51 * 52 * Unicode assigns each code point (not just assigned character) values for 53 * many properties. 54 * Most of them are simple boolean flags, or constants from a small enumerated list. 55 * For some properties, values are strings or other relatively more complex types. 56 * 57 * For more information see 58 * "About the Unicode Character Database" (http://www.unicode.org/ucd/) 59 * and the ICU User Guide chapter on Properties (http://icu-project.org/userguide/properties.html). 60 * 61 * Many functions are designed to match java.lang.Character functions. 62 * See the individual function documentation, 63 * and see the JDK 1.4 java.lang.Character documentation 64 * at http://java.sun.com/j2se/1.4/docs/api/java/lang/Character.html 65 * 66 * There are also functions that provide easy migration from C/POSIX functions 67 * like isblank(). Their use is generally discouraged because the C/POSIX 68 * standards do not define their semantics beyond the ASCII range, which means 69 * that different implementations exhibit very different behavior. 70 * Instead, Unicode properties should be used directly. 71 * 72 * There are also only a few, broad C/POSIX character classes, and they tend 73 * to be used for conflicting purposes. For example, the "isalpha()" class 74 * is sometimes used to determine word boundaries, while a more sophisticated 75 * approach would at least distinguish initial letters from continuation 76 * characters (the latter including combining marks). 77 * (In ICU, BreakIterator is the most sophisticated API for word boundaries.) 78 * Another example: There is no "istitle()" class for titlecase characters. 79 * 80 * ICU 3.4 and later provides API access for all twelve C/POSIX character classes. 81 * ICU implements them according to the Standard Recommendations in 82 * Annex C: Compatibility Properties of UTS #18 Unicode Regular Expressions 83 * (http://www.unicode.org/reports/tr18/#Compatibility_Properties). 84 * 85 * API access for C/POSIX character classes is as follows: 86 * - alpha: u_isUAlphabetic(c) or u_hasBinaryProperty(c, UCHAR_ALPHABETIC) 87 * - lower: u_isULowercase(c) or u_hasBinaryProperty(c, UCHAR_LOWERCASE) 88 * - upper: u_isUUppercase(c) or u_hasBinaryProperty(c, UCHAR_UPPERCASE) 89 * - punct: u_ispunct(c) 90 * - digit: u_isdigit(c) or u_charType(c)==U_DECIMAL_DIGIT_NUMBER 91 * - xdigit: u_isxdigit(c) or u_hasBinaryProperty(c, UCHAR_POSIX_XDIGIT) 92 * - alnum: u_hasBinaryProperty(c, UCHAR_POSIX_ALNUM) 93 * - space: u_isUWhiteSpace(c) or u_hasBinaryProperty(c, UCHAR_WHITE_SPACE) 94 * - blank: u_isblank(c) or u_hasBinaryProperty(c, UCHAR_POSIX_BLANK) 95 * - cntrl: u_charType(c)==U_CONTROL_CHAR 96 * - graph: u_hasBinaryProperty(c, UCHAR_POSIX_GRAPH) 97 * - print: u_hasBinaryProperty(c, UCHAR_POSIX_PRINT) 98 * 99 * Note: Some of the u_isxyz() functions in uchar.h predate, and do not match, 100 * the Standard Recommendations in UTS #18. Instead, they match Java 101 * functions according to their API documentation. 102 * 103 * \htmlonly 104 * The C/POSIX character classes are also available in UnicodeSet patterns, 105 * using patterns like [:graph:] or \p{graph}. 106 * \endhtmlonly 107 * 108 * Note: There are several ICU whitespace functions. 109 * Comparison: 110 * - u_isUWhiteSpace=UCHAR_WHITE_SPACE: Unicode White_Space property; 111 * most of general categories "Z" (separators) + most whitespace ISO controls 112 * (including no-break spaces, but excluding IS1..IS4 and ZWSP) 113 * - u_isWhitespace: Java isWhitespace; Z + whitespace ISO controls but excluding no-break spaces 114 * - u_isJavaSpaceChar: Java isSpaceChar; just Z (including no-break spaces) 115 * - u_isspace: Z + whitespace ISO controls (including no-break spaces) 116 * - u_isblank: "horizontal spaces" = TAB + Zs - ZWSP 117 */ 118 119 /** 120 * Constants. 121 */ 122 123 /** The lowest Unicode code point value. Code points are non-negative. @stable ICU 2.0 */ 124 #define UCHAR_MIN_VALUE 0 125 126 /** 127 * The highest Unicode code point value (scalar value) according to 128 * The Unicode Standard. This is a 21-bit value (20.1 bits, rounded up). 129 * For a single character, UChar32 is a simple type that can hold any code point value. 130 * 131 * @see UChar32 132 * @stable ICU 2.0 133 */ 134 #define UCHAR_MAX_VALUE 0x10ffff 135 136 /** 137 * Get a single-bit bit set (a flag) from a bit number 0..31. 138 * @stable ICU 2.1 139 */ 140 #define U_MASK(x) ((uint32_t)1<<(x)) 141 142 /* 143 * !! Note: Several comments in this file are machine-read by the 144 * genpname tool. These comments describe the correspondence between 145 * icu enum constants and UCD entities. Do not delete them. Update 146 * these comments as needed. 147 * 148 * Any comment of the form "/ *[name]* /" (spaces added) is such 149 * a comment. 150 * 151 * The U_JG_* and U_GC_*_MASK constants are matched by their symbolic 152 * name, which must match PropertyValueAliases.txt. 153 */ 154 155 /** 156 * Selection constants for Unicode properties. 157 * These constants are used in functions like u_hasBinaryProperty to select 158 * one of the Unicode properties. 159 * 160 * The properties APIs are intended to reflect Unicode properties as defined 161 * in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR). 162 * For details about the properties see http://www.unicode.org/ucd/ . 163 * For names of Unicode properties see the UCD file PropertyAliases.txt. 164 * 165 * Important: If ICU is built with UCD files from Unicode versions below, e.g., 3.2, 166 * then properties marked with "new in Unicode 3.2" are not or not fully available. 167 * Check u_getUnicodeVersion to be sure. 168 * 169 * @see u_hasBinaryProperty 170 * @see u_getIntPropertyValue 171 * @see u_getUnicodeVersion 172 * @stable ICU 2.1 173 */ 174 typedef enum UProperty { 175 /* See note !!. Comments of the form "Binary property Dash", 176 "Enumerated property Script", "Double property Numeric_Value", 177 and "String property Age" are read by genpname. */ 178 179 /* Note: Place UCHAR_ALPHABETIC before UCHAR_BINARY_START so that 180 debuggers display UCHAR_ALPHABETIC as the symbolic name for 0, 181 rather than UCHAR_BINARY_START. Likewise for other *_START 182 identifiers. */ 183 184 /** Binary property Alphabetic. Same as u_isUAlphabetic, different from u_isalpha. 185 Lu+Ll+Lt+Lm+Lo+Nl+Other_Alphabetic @stable ICU 2.1 */ 186 UCHAR_ALPHABETIC=0, 187 /** First constant for binary Unicode properties. @stable ICU 2.1 */ 188 UCHAR_BINARY_START=UCHAR_ALPHABETIC, 189 /** Binary property ASCII_Hex_Digit. 0-9 A-F a-f @stable ICU 2.1 */ 190 UCHAR_ASCII_HEX_DIGIT=1, 191 /** Binary property Bidi_Control. 192 Format controls which have specific functions 193 in the Bidi Algorithm. @stable ICU 2.1 */ 194 UCHAR_BIDI_CONTROL=2, 195 /** Binary property Bidi_Mirrored. 196 Characters that may change display in RTL text. 197 Same as u_isMirrored. 198 See Bidi Algorithm, UTR 9. @stable ICU 2.1 */ 199 UCHAR_BIDI_MIRRORED=3, 200 /** Binary property Dash. Variations of dashes. @stable ICU 2.1 */ 201 UCHAR_DASH=4, 202 /** Binary property Default_Ignorable_Code_Point (new in Unicode 3.2). 203 Ignorable in most processing. 204 <2060..206F, FFF0..FFFB, E0000..E0FFF>+Other_Default_Ignorable_Code_Point+(Cf+Cc+Cs-White_Space) @stable ICU 2.1 */ 205 UCHAR_DEFAULT_IGNORABLE_CODE_POINT=5, 206 /** Binary property Deprecated (new in Unicode 3.2). 207 The usage of deprecated characters is strongly discouraged. @stable ICU 2.1 */ 208 UCHAR_DEPRECATED=6, 209 /** Binary property Diacritic. Characters that linguistically modify 210 the meaning of another character to which they apply. @stable ICU 2.1 */ 211 UCHAR_DIACRITIC=7, 212 /** Binary property Extender. 213 Extend the value or shape of a preceding alphabetic character, 214 e.g., length and iteration marks. @stable ICU 2.1 */ 215 UCHAR_EXTENDER=8, 216 /** Binary property Full_Composition_Exclusion. 217 CompositionExclusions.txt+Singleton Decompositions+ 218 Non-Starter Decompositions. @stable ICU 2.1 */ 219 UCHAR_FULL_COMPOSITION_EXCLUSION=9, 220 /** Binary property Grapheme_Base (new in Unicode 3.2). 221 For programmatic determination of grapheme cluster boundaries. 222 [0..10FFFF]-Cc-Cf-Cs-Co-Cn-Zl-Zp-Grapheme_Link-Grapheme_Extend-CGJ @stable ICU 2.1 */ 223 UCHAR_GRAPHEME_BASE=10, 224 /** Binary property Grapheme_Extend (new in Unicode 3.2). 225 For programmatic determination of grapheme cluster boundaries. 226 Me+Mn+Mc+Other_Grapheme_Extend-Grapheme_Link-CGJ @stable ICU 2.1 */ 227 UCHAR_GRAPHEME_EXTEND=11, 228 /** Binary property Grapheme_Link (new in Unicode 3.2). 229 For programmatic determination of grapheme cluster boundaries. @stable ICU 2.1 */ 230 UCHAR_GRAPHEME_LINK=12, 231 /** Binary property Hex_Digit. 232 Characters commonly used for hexadecimal numbers. @stable ICU 2.1 */ 233 UCHAR_HEX_DIGIT=13, 234 /** Binary property Hyphen. Dashes used to mark connections 235 between pieces of words, plus the Katakana middle dot. @stable ICU 2.1 */ 236 UCHAR_HYPHEN=14, 237 /** Binary property ID_Continue. 238 Characters that can continue an identifier. 239 DerivedCoreProperties.txt also says "NOTE: Cf characters should be filtered out." 240 ID_Start+Mn+Mc+Nd+Pc @stable ICU 2.1 */ 241 UCHAR_ID_CONTINUE=15, 242 /** Binary property ID_Start. 243 Characters that can start an identifier. 244 Lu+Ll+Lt+Lm+Lo+Nl @stable ICU 2.1 */ 245 UCHAR_ID_START=16, 246 /** Binary property Ideographic. 247 CJKV ideographs. @stable ICU 2.1 */ 248 UCHAR_IDEOGRAPHIC=17, 249 /** Binary property IDS_Binary_Operator (new in Unicode 3.2). 250 For programmatic determination of 251 Ideographic Description Sequences. @stable ICU 2.1 */ 252 UCHAR_IDS_BINARY_OPERATOR=18, 253 /** Binary property IDS_Trinary_Operator (new in Unicode 3.2). 254 For programmatic determination of 255 Ideographic Description Sequences. @stable ICU 2.1 */ 256 UCHAR_IDS_TRINARY_OPERATOR=19, 257 /** Binary property Join_Control. 258 Format controls for cursive joining and ligation. @stable ICU 2.1 */ 259 UCHAR_JOIN_CONTROL=20, 260 /** Binary property Logical_Order_Exception (new in Unicode 3.2). 261 Characters that do not use logical order and 262 require special handling in most processing. @stable ICU 2.1 */ 263 UCHAR_LOGICAL_ORDER_EXCEPTION=21, 264 /** Binary property Lowercase. Same as u_isULowercase, different from u_islower. 265 Ll+Other_Lowercase @stable ICU 2.1 */ 266 UCHAR_LOWERCASE=22, 267 /** Binary property Math. Sm+Other_Math @stable ICU 2.1 */ 268 UCHAR_MATH=23, 269 /** Binary property Noncharacter_Code_Point. 270 Code points that are explicitly defined as illegal 271 for the encoding of characters. @stable ICU 2.1 */ 272 UCHAR_NONCHARACTER_CODE_POINT=24, 273 /** Binary property Quotation_Mark. @stable ICU 2.1 */ 274 UCHAR_QUOTATION_MARK=25, 275 /** Binary property Radical (new in Unicode 3.2). 276 For programmatic determination of 277 Ideographic Description Sequences. @stable ICU 2.1 */ 278 UCHAR_RADICAL=26, 279 /** Binary property Soft_Dotted (new in Unicode 3.2). 280 Characters with a "soft dot", like i or j. 281 An accent placed on these characters causes 282 the dot to disappear. @stable ICU 2.1 */ 283 UCHAR_SOFT_DOTTED=27, 284 /** Binary property Terminal_Punctuation. 285 Punctuation characters that generally mark 286 the end of textual units. @stable ICU 2.1 */ 287 UCHAR_TERMINAL_PUNCTUATION=28, 288 /** Binary property Unified_Ideograph (new in Unicode 3.2). 289 For programmatic determination of 290 Ideographic Description Sequences. @stable ICU 2.1 */ 291 UCHAR_UNIFIED_IDEOGRAPH=29, 292 /** Binary property Uppercase. Same as u_isUUppercase, different from u_isupper. 293 Lu+Other_Uppercase @stable ICU 2.1 */ 294 UCHAR_UPPERCASE=30, 295 /** Binary property White_Space. 296 Same as u_isUWhiteSpace, different from u_isspace and u_isWhitespace. 297 Space characters+TAB+CR+LF-ZWSP-ZWNBSP @stable ICU 2.1 */ 298 UCHAR_WHITE_SPACE=31, 299 /** Binary property XID_Continue. 300 ID_Continue modified to allow closure under 301 normalization forms NFKC and NFKD. @stable ICU 2.1 */ 302 UCHAR_XID_CONTINUE=32, 303 /** Binary property XID_Start. ID_Start modified to allow 304 closure under normalization forms NFKC and NFKD. @stable ICU 2.1 */ 305 UCHAR_XID_START=33, 306 /** Binary property Case_Sensitive. Either the source of a case 307 mapping or _in_ the target of a case mapping. Not the same as 308 the general category Cased_Letter. @stable ICU 2.6 */ 309 UCHAR_CASE_SENSITIVE=34, 310 /** Binary property STerm (new in Unicode 4.0.1). 311 Sentence Terminal. Used in UAX #29: Text Boundaries 312 (http://www.unicode.org/reports/tr29/) 313 @stable ICU 3.0 */ 314 UCHAR_S_TERM=35, 315 /** Binary property Variation_Selector (new in Unicode 4.0.1). 316 Indicates all those characters that qualify as Variation Selectors. 317 For details on the behavior of these characters, 318 see StandardizedVariants.html and 15.6 Variation Selectors. 319 @stable ICU 3.0 */ 320 UCHAR_VARIATION_SELECTOR=36, 321 /** Binary property NFD_Inert. 322 ICU-specific property for characters that are inert under NFD, 323 i.e., they do not interact with adjacent characters. 324 Used for example in normalizing transforms in incremental mode 325 to find the boundary of safely normalizable text despite possible 326 text additions. 327 328 There is one such property per normalization form. 329 These properties are computed as follows - an inert character is: 330 a) unassigned, or ALL of the following: 331 b) of combining class 0. 332 c) not decomposed by this normalization form. 333 AND if NFC or NFKC, 334 d) can never compose with a previous character. 335 e) can never compose with a following character. 336 f) can never change if another character is added. 337 Example: a-breve might satisfy all but f, but if you 338 add an ogonek it changes to a-ogonek + breve 339 340 See also com.ibm.text.UCD.NFSkippable in the ICU4J repository, 341 and icu/source/common/unormimp.h . 342 @stable ICU 3.0 */ 343 UCHAR_NFD_INERT=37, 344 /** Binary property NFKD_Inert. 345 ICU-specific property for characters that are inert under NFKD, 346 i.e., they do not interact with adjacent characters. 347 Used for example in normalizing transforms in incremental mode 348 to find the boundary of safely normalizable text despite possible 349 text additions. 350 @see UCHAR_NFD_INERT 351 @stable ICU 3.0 */ 352 UCHAR_NFKD_INERT=38, 353 /** Binary property NFC_Inert. 354 ICU-specific property for characters that are inert under NFC, 355 i.e., they do not interact with adjacent characters. 356 Used for example in normalizing transforms in incremental mode 357 to find the boundary of safely normalizable text despite possible 358 text additions. 359 @see UCHAR_NFD_INERT 360 @stable ICU 3.0 */ 361 UCHAR_NFC_INERT=39, 362 /** Binary property NFKC_Inert. 363 ICU-specific property for characters that are inert under NFKC, 364 i.e., they do not interact with adjacent characters. 365 Used for example in normalizing transforms in incremental mode 366 to find the boundary of safely normalizable text despite possible 367 text additions. 368 @see UCHAR_NFD_INERT 369 @stable ICU 3.0 */ 370 UCHAR_NFKC_INERT=40, 371 /** Binary Property Segment_Starter. 372 ICU-specific property for characters that are starters in terms of 373 Unicode normalization and combining character sequences. 374 They have ccc=0 and do not occur in non-initial position of the 375 canonical decomposition of any character 376 (like " in NFD(a-umlaut) and a Jamo T in an NFD(Hangul LVT)). 377 ICU uses this property for segmenting a string for generating a set of 378 canonically equivalent strings, e.g. for canonical closure while 379 processing collation tailoring rules. 380 @stable ICU 3.0 */ 381 UCHAR_SEGMENT_STARTER=41, 382 /** Binary property Pattern_Syntax (new in Unicode 4.1). 383 See UAX #31 Identifier and Pattern Syntax 384 (http://www.unicode.org/reports/tr31/) 385 @stable ICU 3.4 */ 386 UCHAR_PATTERN_SYNTAX=42, 387 /** Binary property Pattern_White_Space (new in Unicode 4.1). 388 See UAX #31 Identifier and Pattern Syntax 389 (http://www.unicode.org/reports/tr31/) 390 @stable ICU 3.4 */ 391 UCHAR_PATTERN_WHITE_SPACE=43, 392 /** Binary property alnum (a C/POSIX character class). 393 Implemented according to the UTS #18 Annex C Standard Recommendation. 394 See the uchar.h file documentation. 395 @stable ICU 3.4 */ 396 UCHAR_POSIX_ALNUM=44, 397 /** Binary property blank (a C/POSIX character class). 398 Implemented according to the UTS #18 Annex C Standard Recommendation. 399 See the uchar.h file documentation. 400 @stable ICU 3.4 */ 401 UCHAR_POSIX_BLANK=45, 402 /** Binary property graph (a C/POSIX character class). 403 Implemented according to the UTS #18 Annex C Standard Recommendation. 404 See the uchar.h file documentation. 405 @stable ICU 3.4 */ 406 UCHAR_POSIX_GRAPH=46, 407 /** Binary property print (a C/POSIX character class). 408 Implemented according to the UTS #18 Annex C Standard Recommendation. 409 See the uchar.h file documentation. 410 @stable ICU 3.4 */ 411 UCHAR_POSIX_PRINT=47, 412 /** Binary property xdigit (a C/POSIX character class). 413 Implemented according to the UTS #18 Annex C Standard Recommendation. 414 See the uchar.h file documentation. 415 @stable ICU 3.4 */ 416 UCHAR_POSIX_XDIGIT=48, 417 /** One more than the last constant for binary Unicode properties. @stable ICU 2.1 */ 418 UCHAR_BINARY_LIMIT=49, 419 420 /** Enumerated property Bidi_Class. 421 Same as u_charDirection, returns UCharDirection values. @stable ICU 2.2 */ 422 UCHAR_BIDI_CLASS=0x1000, 423 /** First constant for enumerated/integer Unicode properties. @stable ICU 2.2 */ 424 UCHAR_INT_START=UCHAR_BIDI_CLASS, 425 /** Enumerated property Block. 426 Same as ublock_getCode, returns UBlockCode values. @stable ICU 2.2 */ 427 UCHAR_BLOCK=0x1001, 428 /** Enumerated property Canonical_Combining_Class. 429 Same as u_getCombiningClass, returns 8-bit numeric values. @stable ICU 2.2 */ 430 UCHAR_CANONICAL_COMBINING_CLASS=0x1002, 431 /** Enumerated property Decomposition_Type. 432 Returns UDecompositionType values. @stable ICU 2.2 */ 433 UCHAR_DECOMPOSITION_TYPE=0x1003, 434 /** Enumerated property East_Asian_Width. 435 See http://www.unicode.org/reports/tr11/ 436 Returns UEastAsianWidth values. @stable ICU 2.2 */ 437 UCHAR_EAST_ASIAN_WIDTH=0x1004, 438 /** Enumerated property General_Category. 439 Same as u_charType, returns UCharCategory values. @stable ICU 2.2 */ 440 UCHAR_GENERAL_CATEGORY=0x1005, 441 /** Enumerated property Joining_Group. 442 Returns UJoiningGroup values. @stable ICU 2.2 */ 443 UCHAR_JOINING_GROUP=0x1006, 444 /** Enumerated property Joining_Type. 445 Returns UJoiningType values. @stable ICU 2.2 */ 446 UCHAR_JOINING_TYPE=0x1007, 447 /** Enumerated property Line_Break. 448 Returns ULineBreak values. @stable ICU 2.2 */ 449 UCHAR_LINE_BREAK=0x1008, 450 /** Enumerated property Numeric_Type. 451 Returns UNumericType values. @stable ICU 2.2 */ 452 UCHAR_NUMERIC_TYPE=0x1009, 453 /** Enumerated property Script. 454 Same as uscript_getScript, returns UScriptCode values. @stable ICU 2.2 */ 455 UCHAR_SCRIPT=0x100A, 456 /** Enumerated property Hangul_Syllable_Type, new in Unicode 4. 457 Returns UHangulSyllableType values. @stable ICU 2.6 */ 458 UCHAR_HANGUL_SYLLABLE_TYPE=0x100B, 459 /** Enumerated property NFD_Quick_Check. 460 Returns UNormalizationCheckResult values. @stable ICU 3.0 */ 461 UCHAR_NFD_QUICK_CHECK=0x100C, 462 /** Enumerated property NFKD_Quick_Check. 463 Returns UNormalizationCheckResult values. @stable ICU 3.0 */ 464 UCHAR_NFKD_QUICK_CHECK=0x100D, 465 /** Enumerated property NFC_Quick_Check. 466 Returns UNormalizationCheckResult values. @stable ICU 3.0 */ 467 UCHAR_NFC_QUICK_CHECK=0x100E, 468 /** Enumerated property NFKC_Quick_Check. 469 Returns UNormalizationCheckResult values. @stable ICU 3.0 */ 470 UCHAR_NFKC_QUICK_CHECK=0x100F, 471 /** Enumerated property Lead_Canonical_Combining_Class. 472 ICU-specific property for the ccc of the first code point 473 of the decomposition, or lccc(c)=ccc(NFD(c)[0]). 474 Useful for checking for canonically ordered text; 475 see UNORM_FCD and http://www.unicode.org/notes/tn5/#FCD . 476 Returns 8-bit numeric values like UCHAR_CANONICAL_COMBINING_CLASS. @stable ICU 3.0 */ 477 UCHAR_LEAD_CANONICAL_COMBINING_CLASS=0x1010, 478 /** Enumerated property Trail_Canonical_Combining_Class. 479 ICU-specific property for the ccc of the last code point 480 of the decomposition, or tccc(c)=ccc(NFD(c)[last]). 481 Useful for checking for canonically ordered text; 482 see UNORM_FCD and http://www.unicode.org/notes/tn5/#FCD . 483 Returns 8-bit numeric values like UCHAR_CANONICAL_COMBINING_CLASS. @stable ICU 3.0 */ 484 UCHAR_TRAIL_CANONICAL_COMBINING_CLASS=0x1011, 485 /** Enumerated property Grapheme_Cluster_Break (new in Unicode 4.1). 486 Used in UAX #29: Text Boundaries 487 (http://www.unicode.org/reports/tr29/) 488 Returns UGraphemeClusterBreak values. @stable ICU 3.4 */ 489 UCHAR_GRAPHEME_CLUSTER_BREAK=0x1012, 490 /** Enumerated property Sentence_Break (new in Unicode 4.1). 491 Used in UAX #29: Text Boundaries 492 (http://www.unicode.org/reports/tr29/) 493 Returns USentenceBreak values. @stable ICU 3.4 */ 494 UCHAR_SENTENCE_BREAK=0x1013, 495 /** Enumerated property Word_Break (new in Unicode 4.1). 496 Used in UAX #29: Text Boundaries 497 (http://www.unicode.org/reports/tr29/) 498 Returns UWordBreakValues values. @stable ICU 3.4 */ 499 UCHAR_WORD_BREAK=0x1014, 500 /** One more than the last constant for enumerated/integer Unicode properties. @stable ICU 2.2 */ 501 UCHAR_INT_LIMIT=0x1015, 502 503 /** Bitmask property General_Category_Mask. 504 This is the General_Category property returned as a bit mask. 505 When used in u_getIntPropertyValue(c), same as U_MASK(u_charType(c)), 506 returns bit masks for UCharCategory values where exactly one bit is set. 507 When used with u_getPropertyValueName() and u_getPropertyValueEnum(), 508 a multi-bit mask is used for sets of categories like "Letters". 509 Mask values should be cast to uint32_t. 510 @stable ICU 2.4 */ 511 UCHAR_GENERAL_CATEGORY_MASK=0x2000, 512 /** First constant for bit-mask Unicode properties. @stable ICU 2.4 */ 513 UCHAR_MASK_START=UCHAR_GENERAL_CATEGORY_MASK, 514 /** One more than the last constant for bit-mask Unicode properties. @stable ICU 2.4 */ 515 UCHAR_MASK_LIMIT=0x2001, 516 517 /** Double property Numeric_Value. 518 Corresponds to u_getNumericValue. @stable ICU 2.4 */ 519 UCHAR_NUMERIC_VALUE=0x3000, 520 /** First constant for double Unicode properties. @stable ICU 2.4 */ 521 UCHAR_DOUBLE_START=UCHAR_NUMERIC_VALUE, 522 /** One more than the last constant for double Unicode properties. @stable ICU 2.4 */ 523 UCHAR_DOUBLE_LIMIT=0x3001, 524 525 /** String property Age. 526 Corresponds to u_charAge. @stable ICU 2.4 */ 527 UCHAR_AGE=0x4000, 528 /** First constant for string Unicode properties. @stable ICU 2.4 */ 529 UCHAR_STRING_START=UCHAR_AGE, 530 /** String property Bidi_Mirroring_Glyph. 531 Corresponds to u_charMirror. @stable ICU 2.4 */ 532 UCHAR_BIDI_MIRRORING_GLYPH=0x4001, 533 /** String property Case_Folding. 534 Corresponds to u_strFoldCase in ustring.h. @stable ICU 2.4 */ 535 UCHAR_CASE_FOLDING=0x4002, 536 /** String property ISO_Comment. 537 Corresponds to u_getISOComment. @stable ICU 2.4 */ 538 UCHAR_ISO_COMMENT=0x4003, 539 /** String property Lowercase_Mapping. 540 Corresponds to u_strToLower in ustring.h. @stable ICU 2.4 */ 541 UCHAR_LOWERCASE_MAPPING=0x4004, 542 /** String property Name. 543 Corresponds to u_charName. @stable ICU 2.4 */ 544 UCHAR_NAME=0x4005, 545 /** String property Simple_Case_Folding. 546 Corresponds to u_foldCase. @stable ICU 2.4 */ 547 UCHAR_SIMPLE_CASE_FOLDING=0x4006, 548 /** String property Simple_Lowercase_Mapping. 549 Corresponds to u_tolower. @stable ICU 2.4 */ 550 UCHAR_SIMPLE_LOWERCASE_MAPPING=0x4007, 551 /** String property Simple_Titlecase_Mapping. 552 Corresponds to u_totitle. @stable ICU 2.4 */ 553 UCHAR_SIMPLE_TITLECASE_MAPPING=0x4008, 554 /** String property Simple_Uppercase_Mapping. 555 Corresponds to u_toupper. @stable ICU 2.4 */ 556 UCHAR_SIMPLE_UPPERCASE_MAPPING=0x4009, 557 /** String property Titlecase_Mapping. 558 Corresponds to u_strToTitle in ustring.h. @stable ICU 2.4 */ 559 UCHAR_TITLECASE_MAPPING=0x400A, 560 /** String property Unicode_1_Name. 561 Corresponds to u_charName. @stable ICU 2.4 */ 562 UCHAR_UNICODE_1_NAME=0x400B, 563 /** String property Uppercase_Mapping. 564 Corresponds to u_strToUpper in ustring.h. @stable ICU 2.4 */ 565 UCHAR_UPPERCASE_MAPPING=0x400C, 566 /** One more than the last constant for string Unicode properties. @stable ICU 2.4 */ 567 UCHAR_STRING_LIMIT=0x400D, 568 569 /** Represents a nonexistent or invalid property or property value. @stable ICU 2.4 */ 570 UCHAR_INVALID_CODE = -1 571 } UProperty; 572 573 /** 574 * Data for enumerated Unicode general category types. 575 * See http://www.unicode.org/Public/UNIDATA/UnicodeData.html . 576 * @stable ICU 2.0 577 */ 578 typedef enum UCharCategory 579 { 580 /** See note !!. Comments of the form "Cn" are read by genpname. */ 581 582 /** Non-category for unassigned and non-character code points. @stable ICU 2.0 */ 583 U_UNASSIGNED = 0, 584 /** Cn "Other, Not Assigned (no characters in [UnicodeData.txt] have this property)" (same as U_UNASSIGNED!) @stable ICU 2.0 */ 585 U_GENERAL_OTHER_TYPES = 0, 586 /** Lu @stable ICU 2.0 */ 587 U_UPPERCASE_LETTER = 1, 588 /** Ll @stable ICU 2.0 */ 589 U_LOWERCASE_LETTER = 2, 590 /** Lt @stable ICU 2.0 */ 591 U_TITLECASE_LETTER = 3, 592 /** Lm @stable ICU 2.0 */ 593 U_MODIFIER_LETTER = 4, 594 /** Lo @stable ICU 2.0 */ 595 U_OTHER_LETTER = 5, 596 /** Mn @stable ICU 2.0 */ 597 U_NON_SPACING_MARK = 6, 598 /** Me @stable ICU 2.0 */ 599 U_ENCLOSING_MARK = 7, 600 /** Mc @stable ICU 2.0 */ 601 U_COMBINING_SPACING_MARK = 8, 602 /** Nd @stable ICU 2.0 */ 603 U_DECIMAL_DIGIT_NUMBER = 9, 604 /** Nl @stable ICU 2.0 */ 605 U_LETTER_NUMBER = 10, 606 /** No @stable ICU 2.0 */ 607 U_OTHER_NUMBER = 11, 608 /** Zs @stable ICU 2.0 */ 609 U_SPACE_SEPARATOR = 12, 610 /** Zl @stable ICU 2.0 */ 611 U_LINE_SEPARATOR = 13, 612 /** Zp @stable ICU 2.0 */ 613 U_PARAGRAPH_SEPARATOR = 14, 614 /** Cc @stable ICU 2.0 */ 615 U_CONTROL_CHAR = 15, 616 /** Cf @stable ICU 2.0 */ 617 U_FORMAT_CHAR = 16, 618 /** Co @stable ICU 2.0 */ 619 U_PRIVATE_USE_CHAR = 17, 620 /** Cs @stable ICU 2.0 */ 621 U_SURROGATE = 18, 622 /** Pd @stable ICU 2.0 */ 623 U_DASH_PUNCTUATION = 19, 624 /** Ps @stable ICU 2.0 */ 625 U_START_PUNCTUATION = 20, 626 /** Pe @stable ICU 2.0 */ 627 U_END_PUNCTUATION = 21, 628 /** Pc @stable ICU 2.0 */ 629 U_CONNECTOR_PUNCTUATION = 22, 630 /** Po @stable ICU 2.0 */ 631 U_OTHER_PUNCTUATION = 23, 632 /** Sm @stable ICU 2.0 */ 633 U_MATH_SYMBOL = 24, 634 /** Sc @stable ICU 2.0 */ 635 U_CURRENCY_SYMBOL = 25, 636 /** Sk @stable ICU 2.0 */ 637 U_MODIFIER_SYMBOL = 26, 638 /** So @stable ICU 2.0 */ 639 U_OTHER_SYMBOL = 27, 640 /** Pi @stable ICU 2.0 */ 641 U_INITIAL_PUNCTUATION = 28, 642 /** Pf @stable ICU 2.0 */ 643 U_FINAL_PUNCTUATION = 29, 644 /** One higher than the last enum UCharCategory constant. @stable ICU 2.0 */ 645 U_CHAR_CATEGORY_COUNT 646 } UCharCategory; 647 648 /** 649 * U_GC_XX_MASK constants are bit flags corresponding to Unicode 650 * general category values. 651 * For each category, the nth bit is set if the numeric value of the 652 * corresponding UCharCategory constant is n. 653 * 654 * There are also some U_GC_Y_MASK constants for groups of general categories 655 * like L for all letter categories. 656 * 657 * @see u_charType 658 * @see U_GET_GC_MASK 659 * @see UCharCategory 660 * @stable ICU 2.1 661 */ 662 #define U_GC_CN_MASK U_MASK(U_GENERAL_OTHER_TYPES) 663 664 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 665 #define U_GC_LU_MASK U_MASK(U_UPPERCASE_LETTER) 666 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 667 #define U_GC_LL_MASK U_MASK(U_LOWERCASE_LETTER) 668 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 669 #define U_GC_LT_MASK U_MASK(U_TITLECASE_LETTER) 670 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 671 #define U_GC_LM_MASK U_MASK(U_MODIFIER_LETTER) 672 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 673 #define U_GC_LO_MASK U_MASK(U_OTHER_LETTER) 674 675 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 676 #define U_GC_MN_MASK U_MASK(U_NON_SPACING_MARK) 677 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 678 #define U_GC_ME_MASK U_MASK(U_ENCLOSING_MARK) 679 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 680 #define U_GC_MC_MASK U_MASK(U_COMBINING_SPACING_MARK) 681 682 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 683 #define U_GC_ND_MASK U_MASK(U_DECIMAL_DIGIT_NUMBER) 684 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 685 #define U_GC_NL_MASK U_MASK(U_LETTER_NUMBER) 686 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 687 #define U_GC_NO_MASK U_MASK(U_OTHER_NUMBER) 688 689 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 690 #define U_GC_ZS_MASK U_MASK(U_SPACE_SEPARATOR) 691 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 692 #define U_GC_ZL_MASK U_MASK(U_LINE_SEPARATOR) 693 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 694 #define U_GC_ZP_MASK U_MASK(U_PARAGRAPH_SEPARATOR) 695 696 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 697 #define U_GC_CC_MASK U_MASK(U_CONTROL_CHAR) 698 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 699 #define U_GC_CF_MASK U_MASK(U_FORMAT_CHAR) 700 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 701 #define U_GC_CO_MASK U_MASK(U_PRIVATE_USE_CHAR) 702 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 703 #define U_GC_CS_MASK U_MASK(U_SURROGATE) 704 705 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 706 #define U_GC_PD_MASK U_MASK(U_DASH_PUNCTUATION) 707 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 708 #define U_GC_PS_MASK U_MASK(U_START_PUNCTUATION) 709 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 710 #define U_GC_PE_MASK U_MASK(U_END_PUNCTUATION) 711 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 712 #define U_GC_PC_MASK U_MASK(U_CONNECTOR_PUNCTUATION) 713 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 714 #define U_GC_PO_MASK U_MASK(U_OTHER_PUNCTUATION) 715 716 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 717 #define U_GC_SM_MASK U_MASK(U_MATH_SYMBOL) 718 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 719 #define U_GC_SC_MASK U_MASK(U_CURRENCY_SYMBOL) 720 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 721 #define U_GC_SK_MASK U_MASK(U_MODIFIER_SYMBOL) 722 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 723 #define U_GC_SO_MASK U_MASK(U_OTHER_SYMBOL) 724 725 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 726 #define U_GC_PI_MASK U_MASK(U_INITIAL_PUNCTUATION) 727 /** Mask constant for a UCharCategory. @stable ICU 2.1 */ 728 #define U_GC_PF_MASK U_MASK(U_FINAL_PUNCTUATION) 729 730 731 /** Mask constant for multiple UCharCategory bits (L Letters). @stable ICU 2.1 */ 732 #define U_GC_L_MASK \ 733 (U_GC_LU_MASK|U_GC_LL_MASK|U_GC_LT_MASK|U_GC_LM_MASK|U_GC_LO_MASK) 734 735 /** Mask constant for multiple UCharCategory bits (LC Cased Letters). @stable ICU 2.1 */ 736 #define U_GC_LC_MASK \ 737 (U_GC_LU_MASK|U_GC_LL_MASK|U_GC_LT_MASK) 738 739 /** Mask constant for multiple UCharCategory bits (M Marks). @stable ICU 2.1 */ 740 #define U_GC_M_MASK (U_GC_MN_MASK|U_GC_ME_MASK|U_GC_MC_MASK) 741 742 /** Mask constant for multiple UCharCategory bits (N Numbers). @stable ICU 2.1 */ 743 #define U_GC_N_MASK (U_GC_ND_MASK|U_GC_NL_MASK|U_GC_NO_MASK) 744 745 /** Mask constant for multiple UCharCategory bits (Z Separators). @stable ICU 2.1 */ 746 #define U_GC_Z_MASK (U_GC_ZS_MASK|U_GC_ZL_MASK|U_GC_ZP_MASK) 747 748 /** Mask constant for multiple UCharCategory bits (C Others). @stable ICU 2.1 */ 749 #define U_GC_C_MASK \ 750 (U_GC_CN_MASK|U_GC_CC_MASK|U_GC_CF_MASK|U_GC_CO_MASK|U_GC_CS_MASK) 751 752 /** Mask constant for multiple UCharCategory bits (P Punctuation). @stable ICU 2.1 */ 753 #define U_GC_P_MASK \ 754 (U_GC_PD_MASK|U_GC_PS_MASK|U_GC_PE_MASK|U_GC_PC_MASK|U_GC_PO_MASK| \ 755 U_GC_PI_MASK|U_GC_PF_MASK) 756 757 /** Mask constant for multiple UCharCategory bits (S Symbols). @stable ICU 2.1 */ 758 #define U_GC_S_MASK (U_GC_SM_MASK|U_GC_SC_MASK|U_GC_SK_MASK|U_GC_SO_MASK) 759 760 /** 761 * This specifies the language directional property of a character set. 762 * @stable ICU 2.0 763 */ 764 typedef enum UCharDirection { 765 /** See note !!. Comments of the form "EN" are read by genpname. */ 766 767 /** L @stable ICU 2.0 */ 768 U_LEFT_TO_RIGHT = 0, 769 /** R @stable ICU 2.0 */ 770 U_RIGHT_TO_LEFT = 1, 771 /** EN @stable ICU 2.0 */ 772 U_EUROPEAN_NUMBER = 2, 773 /** ES @stable ICU 2.0 */ 774 U_EUROPEAN_NUMBER_SEPARATOR = 3, 775 /** ET @stable ICU 2.0 */ 776 U_EUROPEAN_NUMBER_TERMINATOR = 4, 777 /** AN @stable ICU 2.0 */ 778 U_ARABIC_NUMBER = 5, 779 /** CS @stable ICU 2.0 */ 780 U_COMMON_NUMBER_SEPARATOR = 6, 781 /** B @stable ICU 2.0 */ 782 U_BLOCK_SEPARATOR = 7, 783 /** S @stable ICU 2.0 */ 784 U_SEGMENT_SEPARATOR = 8, 785 /** WS @stable ICU 2.0 */ 786 U_WHITE_SPACE_NEUTRAL = 9, 787 /** ON @stable ICU 2.0 */ 788 U_OTHER_NEUTRAL = 10, 789 /** LRE @stable ICU 2.0 */ 790 U_LEFT_TO_RIGHT_EMBEDDING = 11, 791 /** LRO @stable ICU 2.0 */ 792 U_LEFT_TO_RIGHT_OVERRIDE = 12, 793 /** AL @stable ICU 2.0 */ 794 U_RIGHT_TO_LEFT_ARABIC = 13, 795 /** RLE @stable ICU 2.0 */ 796 U_RIGHT_TO_LEFT_EMBEDDING = 14, 797 /** RLO @stable ICU 2.0 */ 798 U_RIGHT_TO_LEFT_OVERRIDE = 15, 799 /** PDF @stable ICU 2.0 */ 800 U_POP_DIRECTIONAL_FORMAT = 16, 801 /** NSM @stable ICU 2.0 */ 802 U_DIR_NON_SPACING_MARK = 17, 803 /** BN @stable ICU 2.0 */ 804 U_BOUNDARY_NEUTRAL = 18, 805 /** @stable ICU 2.0 */ 806 U_CHAR_DIRECTION_COUNT 807 } UCharDirection; 808 809 /** 810 * Constants for Unicode blocks, see the Unicode Data file Blocks.txt 811 * @stable ICU 2.0 812 */ 813 enum UBlockCode { 814 815 /** New No_Block value in Unicode 4. @stable ICU 2.6 */ 816 UBLOCK_NO_BLOCK = 0, /*[none]*/ /* Special range indicating No_Block */ 817 818 /** @stable ICU 2.0 */ 819 UBLOCK_BASIC_LATIN = 1, /*[0000]*/ /*See note !!*/ 820 821 /** @stable ICU 2.0 */ 822 UBLOCK_LATIN_1_SUPPLEMENT=2, /*[0080]*/ 823 824 /** @stable ICU 2.0 */ 825 UBLOCK_LATIN_EXTENDED_A =3, /*[0100]*/ 826 827 /** @stable ICU 2.0 */ 828 UBLOCK_LATIN_EXTENDED_B =4, /*[0180]*/ 829 830 /** @stable ICU 2.0 */ 831 UBLOCK_IPA_EXTENSIONS =5, /*[0250]*/ 832 833 /** @stable ICU 2.0 */ 834 UBLOCK_SPACING_MODIFIER_LETTERS =6, /*[02B0]*/ 835 836 /** @stable ICU 2.0 */ 837 UBLOCK_COMBINING_DIACRITICAL_MARKS =7, /*[0300]*/ 838 839 /** 840 * Unicode 3.2 renames this block to "Greek and Coptic". 841 * @stable ICU 2.0 842 */ 843 UBLOCK_GREEK =8, /*[0370]*/ 844 845 /** @stable ICU 2.0 */ 846 UBLOCK_CYRILLIC =9, /*[0400]*/ 847 848 /** @stable ICU 2.0 */ 849 UBLOCK_ARMENIAN =10, /*[0530]*/ 850 851 /** @stable ICU 2.0 */ 852 UBLOCK_HEBREW =11, /*[0590]*/ 853 854 /** @stable ICU 2.0 */ 855 UBLOCK_ARABIC =12, /*[0600]*/ 856 857 /** @stable ICU 2.0 */ 858 UBLOCK_SYRIAC =13, /*[0700]*/ 859 860 /** @stable ICU 2.0 */ 861 UBLOCK_THAANA =14, /*[0780]*/ 862 863 /** @stable ICU 2.0 */ 864 UBLOCK_DEVANAGARI =15, /*[0900]*/ 865 866 /** @stable ICU 2.0 */ 867 UBLOCK_BENGALI =16, /*[0980]*/ 868 869 /** @stable ICU 2.0 */ 870 UBLOCK_GURMUKHI =17, /*[0A00]*/ 871 872 /** @stable ICU 2.0 */ 873 UBLOCK_GUJARATI =18, /*[0A80]*/ 874 875 /** @stable ICU 2.0 */ 876 UBLOCK_ORIYA =19, /*[0B00]*/ 877 878 /** @stable ICU 2.0 */ 879 UBLOCK_TAMIL =20, /*[0B80]*/ 880 881 /** @stable ICU 2.0 */ 882 UBLOCK_TELUGU =21, /*[0C00]*/ 883 884 /** @stable ICU 2.0 */ 885 UBLOCK_KANNADA =22, /*[0C80]*/ 886 887 /** @stable ICU 2.0 */ 888 UBLOCK_MALAYALAM =23, /*[0D00]*/ 889 890 /** @stable ICU 2.0 */ 891 UBLOCK_SINHALA =24, /*[0D80]*/ 892 893 /** @stable ICU 2.0 */ 894 UBLOCK_THAI =25, /*[0E00]*/ 895 896 /** @stable ICU 2.0 */ 897 UBLOCK_LAO =26, /*[0E80]*/ 898 899 /** @stable ICU 2.0 */ 900 UBLOCK_TIBETAN =27, /*[0F00]*/ 901 902 /** @stable ICU 2.0 */ 903 UBLOCK_MYANMAR =28, /*[1000]*/ 904 905 /** @stable ICU 2.0 */ 906 UBLOCK_GEORGIAN =29, /*[10A0]*/ 907 908 /** @stable ICU 2.0 */ 909 UBLOCK_HANGUL_JAMO =30, /*[1100]*/ 910 911 /** @stable ICU 2.0 */ 912 UBLOCK_ETHIOPIC =31, /*[1200]*/ 913 914 /** @stable ICU 2.0 */ 915 UBLOCK_CHEROKEE =32, /*[13A0]*/ 916 917 /** @stable ICU 2.0 */ 918 UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS =33, /*[1400]*/ 919 920 /** @stable ICU 2.0 */ 921 UBLOCK_OGHAM =34, /*[1680]*/ 922 923 /** @stable ICU 2.0 */ 924 UBLOCK_RUNIC =35, /*[16A0]*/ 925 926 /** @stable ICU 2.0 */ 927 UBLOCK_KHMER =36, /*[1780]*/ 928 929 /** @stable ICU 2.0 */ 930 UBLOCK_MONGOLIAN =37, /*[1800]*/ 931 932 /** @stable ICU 2.0 */ 933 UBLOCK_LATIN_EXTENDED_ADDITIONAL =38, /*[1E00]*/ 934 935 /** @stable ICU 2.0 */ 936 UBLOCK_GREEK_EXTENDED =39, /*[1F00]*/ 937 938 /** @stable ICU 2.0 */ 939 UBLOCK_GENERAL_PUNCTUATION =40, /*[2000]*/ 940 941 /** @stable ICU 2.0 */ 942 UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS =41, /*[2070]*/ 943 944 /** @stable ICU 2.0 */ 945 UBLOCK_CURRENCY_SYMBOLS =42, /*[20A0]*/ 946 947 /** 948 * Unicode 3.2 renames this block to "Combining Diacritical Marks for Symbols". 949 * @stable ICU 2.0 950 */ 951 UBLOCK_COMBINING_MARKS_FOR_SYMBOLS =43, /*[20D0]*/ 952 953 /** @stable ICU 2.0 */ 954 UBLOCK_LETTERLIKE_SYMBOLS =44, /*[2100]*/ 955 956 /** @stable ICU 2.0 */ 957 UBLOCK_NUMBER_FORMS =45, /*[2150]*/ 958 959 /** @stable ICU 2.0 */ 960 UBLOCK_ARROWS =46, /*[2190]*/ 961 962 /** @stable ICU 2.0 */ 963 UBLOCK_MATHEMATICAL_OPERATORS =47, /*[2200]*/ 964 965 /** @stable ICU 2.0 */ 966 UBLOCK_MISCELLANEOUS_TECHNICAL =48, /*[2300]*/ 967 968 /** @stable ICU 2.0 */ 969 UBLOCK_CONTROL_PICTURES =49, /*[2400]*/ 970 971 /** @stable ICU 2.0 */ 972 UBLOCK_OPTICAL_CHARACTER_RECOGNITION =50, /*[2440]*/ 973 974 /** @stable ICU 2.0 */ 975 UBLOCK_ENCLOSED_ALPHANUMERICS =51, /*[2460]*/ 976 977 /** @stable ICU 2.0 */ 978 UBLOCK_BOX_DRAWING =52, /*[2500]*/ 979 980 /** @stable ICU 2.0 */ 981 UBLOCK_BLOCK_ELEMENTS =53, /*[2580]*/ 982 983 /** @stable ICU 2.0 */ 984 UBLOCK_GEOMETRIC_SHAPES =54, /*[25A0]*/ 985 986 /** @stable ICU 2.0 */ 987 UBLOCK_MISCELLANEOUS_SYMBOLS =55, /*[2600]*/ 988 989 /** @stable ICU 2.0 */ 990 UBLOCK_DINGBATS =56, /*[2700]*/ 991 992 /** @stable ICU 2.0 */ 993 UBLOCK_BRAILLE_PATTERNS =57, /*[2800]*/ 994 995 /** @stable ICU 2.0 */ 996 UBLOCK_CJK_RADICALS_SUPPLEMENT =58, /*[2E80]*/ 997 998 /** @stable ICU 2.0 */ 999 UBLOCK_KANGXI_RADICALS =59, /*[2F00]*/ 1000 1001 /** @stable ICU 2.0 */ 1002 UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS =60, /*[2FF0]*/ 1003 1004 /** @stable ICU 2.0 */ 1005 UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION =61, /*[3000]*/ 1006 1007 /** @stable ICU 2.0 */ 1008 UBLOCK_HIRAGANA =62, /*[3040]*/ 1009 1010 /** @stable ICU 2.0 */ 1011 UBLOCK_KATAKANA =63, /*[30A0]*/ 1012 1013 /** @stable ICU 2.0 */ 1014 UBLOCK_BOPOMOFO =64, /*[3100]*/ 1015 1016 /** @stable ICU 2.0 */ 1017 UBLOCK_HANGUL_COMPATIBILITY_JAMO =65, /*[3130]*/ 1018 1019 /** @stable ICU 2.0 */ 1020 UBLOCK_KANBUN =66, /*[3190]*/ 1021 1022 /** @stable ICU 2.0 */ 1023 UBLOCK_BOPOMOFO_EXTENDED =67, /*[31A0]*/ 1024 1025 /** @stable ICU 2.0 */ 1026 UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS =68, /*[3200]*/ 1027 1028 /** @stable ICU 2.0 */ 1029 UBLOCK_CJK_COMPATIBILITY =69, /*[3300]*/ 1030 1031 /** @stable ICU 2.0 */ 1032 UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A =70, /*[3400]*/ 1033 1034 /** @stable ICU 2.0 */ 1035 UBLOCK_CJK_UNIFIED_IDEOGRAPHS =71, /*[4E00]*/ 1036 1037 /** @stable ICU 2.0 */ 1038 UBLOCK_YI_SYLLABLES =72, /*[A000]*/ 1039 1040 /** @stable ICU 2.0 */ 1041 UBLOCK_YI_RADICALS =73, /*[A490]*/ 1042 1043 /** @stable ICU 2.0 */ 1044 UBLOCK_HANGUL_SYLLABLES =74, /*[AC00]*/ 1045 1046 /** @stable ICU 2.0 */ 1047 UBLOCK_HIGH_SURROGATES =75, /*[D800]*/ 1048 1049 /** @stable ICU 2.0 */ 1050 UBLOCK_HIGH_PRIVATE_USE_SURROGATES =76, /*[DB80]*/ 1051 1052 /** @stable ICU 2.0 */ 1053 UBLOCK_LOW_SURROGATES =77, /*[DC00]*/ 1054 1055 /** 1056 * Same as UBLOCK_PRIVATE_USE_AREA. 1057 * Until Unicode 3.1.1, the corresponding block name was "Private Use", 1058 * and multiple code point ranges had this block. 1059 * Unicode 3.2 renames the block for the BMP PUA to "Private Use Area" and 1060 * adds separate blocks for the supplementary PUAs. 1061 * 1062 * @stable ICU 2.0 1063 */ 1064 UBLOCK_PRIVATE_USE = 78, 1065 /** 1066 * Same as UBLOCK_PRIVATE_USE. 1067 * Until Unicode 3.1.1, the corresponding block name was "Private Use", 1068 * and multiple code point ranges had this block. 1069 * Unicode 3.2 renames the block for the BMP PUA to "Private Use Area" and 1070 * adds separate blocks for the supplementary PUAs. 1071 * 1072 * @stable ICU 2.0 1073 */ 1074 UBLOCK_PRIVATE_USE_AREA =UBLOCK_PRIVATE_USE, /*[E000]*/ 1075 1076 /** @stable ICU 2.0 */ 1077 UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS =79, /*[F900]*/ 1078 1079 /** @stable ICU 2.0 */ 1080 UBLOCK_ALPHABETIC_PRESENTATION_FORMS =80, /*[FB00]*/ 1081 1082 /** @stable ICU 2.0 */ 1083 UBLOCK_ARABIC_PRESENTATION_FORMS_A =81, /*[FB50]*/ 1084 1085 /** @stable ICU 2.0 */ 1086 UBLOCK_COMBINING_HALF_MARKS =82, /*[FE20]*/ 1087 1088 /** @stable ICU 2.0 */ 1089 UBLOCK_CJK_COMPATIBILITY_FORMS =83, /*[FE30]*/ 1090 1091 /** @stable ICU 2.0 */ 1092 UBLOCK_SMALL_FORM_VARIANTS =84, /*[FE50]*/ 1093 1094 /** @stable ICU 2.0 */ 1095 UBLOCK_ARABIC_PRESENTATION_FORMS_B =85, /*[FE70]*/ 1096 1097 /** @stable ICU 2.0 */ 1098 UBLOCK_SPECIALS =86, /*[FFF0]*/ 1099 1100 /** @stable ICU 2.0 */ 1101 UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS =87, /*[FF00]*/ 1102 1103 /* New blocks in Unicode 3.1 */ 1104 1105 /** @stable ICU 2.0 */ 1106 UBLOCK_OLD_ITALIC = 88 , /*[10300]*/ 1107 /** @stable ICU 2.0 */ 1108 UBLOCK_GOTHIC = 89 , /*[10330]*/ 1109 /** @stable ICU 2.0 */ 1110 UBLOCK_DESERET = 90 , /*[10400]*/ 1111 /** @stable ICU 2.0 */ 1112 UBLOCK_BYZANTINE_MUSICAL_SYMBOLS = 91 , /*[1D000]*/ 1113 /** @stable ICU 2.0 */ 1114 UBLOCK_MUSICAL_SYMBOLS = 92 , /*[1D100]*/ 1115 /** @stable ICU 2.0 */ 1116 UBLOCK_MATHEMATICAL_ALPHANUMERIC_SYMBOLS = 93 , /*[1D400]*/ 1117 /** @stable ICU 2.0 */ 1118 UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B = 94 , /*[20000]*/ 1119 /** @stable ICU 2.0 */ 1120 UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT = 95 , /*[2F800]*/ 1121 /** @stable ICU 2.0 */ 1122 UBLOCK_TAGS = 96, /*[E0000]*/ 1123 1124 /* New blocks in Unicode 3.2 */ 1125 1126 /** 1127 * Unicode 4.0.1 renames the "Cyrillic Supplementary" block to "Cyrillic Supplement". 1128 * @stable ICU 2.2 1129 */ 1130 UBLOCK_CYRILLIC_SUPPLEMENTARY = 97, 1131 /** @stable ICU 3.0 */ 1132 UBLOCK_CYRILLIC_SUPPLEMENT = UBLOCK_CYRILLIC_SUPPLEMENTARY, /*[0500]*/ 1133 /** @stable ICU 2.2 */ 1134 UBLOCK_TAGALOG = 98, /*[1700]*/ 1135 /** @stable ICU 2.2 */ 1136 UBLOCK_HANUNOO = 99, /*[1720]*/ 1137 /** @stable ICU 2.2 */ 1138 UBLOCK_BUHID = 100, /*[1740]*/ 1139 /** @stable ICU 2.2 */ 1140 UBLOCK_TAGBANWA = 101, /*[1760]*/ 1141 /** @stable ICU 2.2 */ 1142 UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A = 102, /*[27C0]*/ 1143 /** @stable ICU 2.2 */ 1144 UBLOCK_SUPPLEMENTAL_ARROWS_A = 103, /*[27F0]*/ 1145 /** @stable ICU 2.2 */ 1146 UBLOCK_SUPPLEMENTAL_ARROWS_B = 104, /*[2900]*/ 1147 /** @stable ICU 2.2 */ 1148 UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B = 105, /*[2980]*/ 1149 /** @stable ICU 2.2 */ 1150 UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS = 106, /*[2A00]*/ 1151 /** @stable ICU 2.2 */ 1152 UBLOCK_KATAKANA_PHONETIC_EXTENSIONS = 107, /*[31F0]*/ 1153 /** @stable ICU 2.2 */ 1154 UBLOCK_VARIATION_SELECTORS = 108, /*[FE00]*/ 1155 /** @stable ICU 2.2 */ 1156 UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_A = 109, /*[F0000]*/ 1157 /** @stable ICU 2.2 */ 1158 UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_B = 110, /*[100000]*/ 1159 1160 /* New blocks in Unicode 4 */ 1161 1162 /** @stable ICU 2.6 */ 1163 UBLOCK_LIMBU = 111, /*[1900]*/ 1164 /** @stable ICU 2.6 */ 1165 UBLOCK_TAI_LE = 112, /*[1950]*/ 1166 /** @stable ICU 2.6 */ 1167 UBLOCK_KHMER_SYMBOLS = 113, /*[19E0]*/ 1168 /** @stable ICU 2.6 */ 1169 UBLOCK_PHONETIC_EXTENSIONS = 114, /*[1D00]*/ 1170 /** @stable ICU 2.6 */ 1171 UBLOCK_MISCELLANEOUS_SYMBOLS_AND_ARROWS = 115, /*[2B00]*/ 1172 /** @stable ICU 2.6 */ 1173 UBLOCK_YIJING_HEXAGRAM_SYMBOLS = 116, /*[4DC0]*/ 1174 /** @stable ICU 2.6 */ 1175 UBLOCK_LINEAR_B_SYLLABARY = 117, /*[10000]*/ 1176 /** @stable ICU 2.6 */ 1177 UBLOCK_LINEAR_B_IDEOGRAMS = 118, /*[10080]*/ 1178 /** @stable ICU 2.6 */ 1179 UBLOCK_AEGEAN_NUMBERS = 119, /*[10100]*/ 1180 /** @stable ICU 2.6 */ 1181 UBLOCK_UGARITIC = 120, /*[10380]*/ 1182 /** @stable ICU 2.6 */ 1183 UBLOCK_SHAVIAN = 121, /*[10450]*/ 1184 /** @stable ICU 2.6 */ 1185 UBLOCK_OSMANYA = 122, /*[10480]*/ 1186 /** @stable ICU 2.6 */ 1187 UBLOCK_CYPRIOT_SYLLABARY = 123, /*[10800]*/ 1188 /** @stable ICU 2.6 */ 1189 UBLOCK_TAI_XUAN_JING_SYMBOLS = 124, /*[1D300]*/ 1190 /** @stable ICU 2.6 */ 1191 UBLOCK_VARIATION_SELECTORS_SUPPLEMENT = 125, /*[E0100]*/ 1192 1193 /* New blocks in Unicode 4.1 */ 1194 1195 /** @stable ICU 3.4 */ 1196 UBLOCK_ANCIENT_GREEK_MUSICAL_NOTATION = 126, /*[1D200]*/ 1197 /** @stable ICU 3.4 */ 1198 UBLOCK_ANCIENT_GREEK_NUMBERS = 127, /*[10140]*/ 1199 /** @stable ICU 3.4 */ 1200 UBLOCK_ARABIC_SUPPLEMENT = 128, /*[0750]*/ 1201 /** @stable ICU 3.4 */ 1202 UBLOCK_BUGINESE = 129, /*[1A00]*/ 1203 /** @stable ICU 3.4 */ 1204 UBLOCK_CJK_STROKES = 130, /*[31C0]*/ 1205 /** @stable ICU 3.4 */ 1206 UBLOCK_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT = 131, /*[1DC0]*/ 1207 /** @stable ICU 3.4 */ 1208 UBLOCK_COPTIC = 132, /*[2C80]*/ 1209 /** @stable ICU 3.4 */ 1210 UBLOCK_ETHIOPIC_EXTENDED = 133, /*[2D80]*/ 1211 /** @stable ICU 3.4 */ 1212 UBLOCK_ETHIOPIC_SUPPLEMENT = 134, /*[1380]*/ 1213 /** @stable ICU 3.4 */ 1214 UBLOCK_GEORGIAN_SUPPLEMENT = 135, /*[2D00]*/ 1215 /** @stable ICU 3.4 */ 1216 UBLOCK_GLAGOLITIC = 136, /*[2C00]*/ 1217 /** @stable ICU 3.4 */ 1218 UBLOCK_KHAROSHTHI = 137, /*[10A00]*/ 1219 /** @stable ICU 3.4 */ 1220 UBLOCK_MODIFIER_TONE_LETTERS = 138, /*[A700]*/ 1221 /** @stable ICU 3.4 */ 1222 UBLOCK_NEW_TAI_LUE = 139, /*[1980]*/ 1223 /** @stable ICU 3.4 */ 1224 UBLOCK_OLD_PERSIAN = 140, /*[103A0]*/ 1225 /** @stable ICU 3.4 */ 1226 UBLOCK_PHONETIC_EXTENSIONS_SUPPLEMENT = 141, /*[1D80]*/ 1227 /** @stable ICU 3.4 */ 1228 UBLOCK_SUPPLEMENTAL_PUNCTUATION = 142, /*[2E00]*/ 1229 /** @stable ICU 3.4 */ 1230 UBLOCK_SYLOTI_NAGRI = 143, /*[A800]*/ 1231 /** @stable ICU 3.4 */ 1232 UBLOCK_TIFINAGH = 144, /*[2D30]*/ 1233 /** @stable ICU 3.4 */ 1234 UBLOCK_VERTICAL_FORMS = 145, /*[FE10]*/ 1235 1236 /* New blocks in Unicode 5.0 */ 1237 1238 /** @stable ICU 3.6 */ 1239 UBLOCK_NKO = 146, /*[07C0]*/ 1240 /** @stable ICU 3.6 */ 1241 UBLOCK_BALINESE = 147, /*[1B00]*/ 1242 /** @stable ICU 3.6 */ 1243 UBLOCK_LATIN_EXTENDED_C = 148, /*[2C60]*/ 1244 /** @stable ICU 3.6 */ 1245 UBLOCK_LATIN_EXTENDED_D = 149, /*[A720]*/ 1246 /** @stable ICU 3.6 */ 1247 UBLOCK_PHAGS_PA = 150, /*[A840]*/ 1248 /** @stable ICU 3.6 */ 1249 UBLOCK_PHOENICIAN = 151, /*[10900]*/ 1250 /** @stable ICU 3.6 */ 1251 UBLOCK_CUNEIFORM = 152, /*[12000]*/ 1252 /** @stable ICU 3.6 */ 1253 UBLOCK_CUNEIFORM_NUMBERS_AND_PUNCTUATION = 153, /*[12400]*/ 1254 /** @stable ICU 3.6 */ 1255 UBLOCK_COUNTING_ROD_NUMERALS = 154, /*[1D360]*/ 1256 1257 /* New blocks in Unicode 5.1 */ 1258 1259 /** @stable ICU 4.0 */ 1260 UBLOCK_SUNDANESE = 155, /*[1B80]*/ 1261 /** @stable ICU 4.0 */ 1262 UBLOCK_LEPCHA = 156, /*[1C00]*/ 1263 /** @stable ICU 4.0 */ 1264 UBLOCK_OL_CHIKI = 157, /*[1C50]*/ 1265 /** @stable ICU 4.0 */ 1266 UBLOCK_CYRILLIC_EXTENDED_A = 158, /*[2DE0]*/ 1267 /** @stable ICU 4.0 */ 1268 UBLOCK_VAI = 159, /*[A500]*/ 1269 /** @stable ICU 4.0 */ 1270 UBLOCK_CYRILLIC_EXTENDED_B = 160, /*[A640]*/ 1271 /** @stable ICU 4.0 */ 1272 UBLOCK_SAURASHTRA = 161, /*[A880]*/ 1273 /** @stable ICU 4.0 */ 1274 UBLOCK_KAYAH_LI = 162, /*[A900]*/ 1275 /** @stable ICU 4.0 */ 1276 UBLOCK_REJANG = 163, /*[A930]*/ 1277 /** @stable ICU 4.0 */ 1278 UBLOCK_CHAM = 164, /*[AA00]*/ 1279 /** @stable ICU 4.0 */ 1280 UBLOCK_ANCIENT_SYMBOLS = 165, /*[10190]*/ 1281 /** @stable ICU 4.0 */ 1282 UBLOCK_PHAISTOS_DISC = 166, /*[101D0]*/ 1283 /** @stable ICU 4.0 */ 1284 UBLOCK_LYCIAN = 167, /*[10280]*/ 1285 /** @stable ICU 4.0 */ 1286 UBLOCK_CARIAN = 168, /*[102A0]*/ 1287 /** @stable ICU 4.0 */ 1288 UBLOCK_LYDIAN = 169, /*[10920]*/ 1289 /** @stable ICU 4.0 */ 1290 UBLOCK_MAHJONG_TILES = 170, /*[1F000]*/ 1291 /** @stable ICU 4.0 */ 1292 UBLOCK_DOMINO_TILES = 171, /*[1F030]*/ 1293 1294 /** @stable ICU 2.0 */ 1295 UBLOCK_COUNT = 172, 1296 1297 /** @stable ICU 2.0 */ 1298 UBLOCK_INVALID_CODE=-1 1299 }; 1300 1301 /** @stable ICU 2.0 */ 1302 typedef enum UBlockCode UBlockCode; 1303 1304 /** 1305 * East Asian Width constants. 1306 * 1307 * @see UCHAR_EAST_ASIAN_WIDTH 1308 * @see u_getIntPropertyValue 1309 * @stable ICU 2.2 1310 */ 1311 typedef enum UEastAsianWidth { 1312 U_EA_NEUTRAL, /*[N]*/ /*See note !!*/ 1313 U_EA_AMBIGUOUS, /*[A]*/ 1314 U_EA_HALFWIDTH, /*[H]*/ 1315 U_EA_FULLWIDTH, /*[F]*/ 1316 U_EA_NARROW, /*[Na]*/ 1317 U_EA_WIDE, /*[W]*/ 1318 U_EA_COUNT 1319 } UEastAsianWidth; 1320 /* 1321 * Implementation note: 1322 * Keep UEastAsianWidth constant values in sync with names list in genprops/props2.c. 1323 */ 1324 1325 /** 1326 * Selector constants for u_charName(). 1327 * u_charName() returns the "modern" name of a 1328 * Unicode character; or the name that was defined in 1329 * Unicode version 1.0, before the Unicode standard merged 1330 * with ISO-10646; or an "extended" name that gives each 1331 * Unicode code point a unique name. 1332 * 1333 * @see u_charName 1334 * @stable ICU 2.0 1335 */ 1336 typedef enum UCharNameChoice { 1337 U_UNICODE_CHAR_NAME, 1338 U_UNICODE_10_CHAR_NAME, 1339 U_EXTENDED_CHAR_NAME, 1340 U_CHAR_NAME_CHOICE_COUNT 1341 } UCharNameChoice; 1342 1343 /** 1344 * Selector constants for u_getPropertyName() and 1345 * u_getPropertyValueName(). These selectors are used to choose which 1346 * name is returned for a given property or value. All properties and 1347 * values have a long name. Most have a short name, but some do not. 1348 * Unicode allows for additional names, beyond the long and short 1349 * name, which would be indicated by U_LONG_PROPERTY_NAME + i, where 1350 * i=1, 2,... 1351 * 1352 * @see u_getPropertyName() 1353 * @see u_getPropertyValueName() 1354 * @stable ICU 2.4 1355 */ 1356 typedef enum UPropertyNameChoice { 1357 U_SHORT_PROPERTY_NAME, 1358 U_LONG_PROPERTY_NAME, 1359 U_PROPERTY_NAME_CHOICE_COUNT 1360 } UPropertyNameChoice; 1361 1362 /** 1363 * Decomposition Type constants. 1364 * 1365 * @see UCHAR_DECOMPOSITION_TYPE 1366 * @stable ICU 2.2 1367 */ 1368 typedef enum UDecompositionType { 1369 U_DT_NONE, /*[none]*/ /*See note !!*/ 1370 U_DT_CANONICAL, /*[can]*/ 1371 U_DT_COMPAT, /*[com]*/ 1372 U_DT_CIRCLE, /*[enc]*/ 1373 U_DT_FINAL, /*[fin]*/ 1374 U_DT_FONT, /*[font]*/ 1375 U_DT_FRACTION, /*[fra]*/ 1376 U_DT_INITIAL, /*[init]*/ 1377 U_DT_ISOLATED, /*[iso]*/ 1378 U_DT_MEDIAL, /*[med]*/ 1379 U_DT_NARROW, /*[nar]*/ 1380 U_DT_NOBREAK, /*[nb]*/ 1381 U_DT_SMALL, /*[sml]*/ 1382 U_DT_SQUARE, /*[sqr]*/ 1383 U_DT_SUB, /*[sub]*/ 1384 U_DT_SUPER, /*[sup]*/ 1385 U_DT_VERTICAL, /*[vert]*/ 1386 U_DT_WIDE, /*[wide]*/ 1387 U_DT_COUNT /* 18 */ 1388 } UDecompositionType; 1389 1390 /** 1391 * Joining Type constants. 1392 * 1393 * @see UCHAR_JOINING_TYPE 1394 * @stable ICU 2.2 1395 */ 1396 typedef enum UJoiningType { 1397 U_JT_NON_JOINING, /*[U]*/ /*See note !!*/ 1398 U_JT_JOIN_CAUSING, /*[C]*/ 1399 U_JT_DUAL_JOINING, /*[D]*/ 1400 U_JT_LEFT_JOINING, /*[L]*/ 1401 U_JT_RIGHT_JOINING, /*[R]*/ 1402 U_JT_TRANSPARENT, /*[T]*/ 1403 U_JT_COUNT /* 6 */ 1404 } UJoiningType; 1405 1406 /** 1407 * Joining Group constants. 1408 * 1409 * @see UCHAR_JOINING_GROUP 1410 * @stable ICU 2.2 1411 */ 1412 typedef enum UJoiningGroup { 1413 U_JG_NO_JOINING_GROUP, 1414 U_JG_AIN, 1415 U_JG_ALAPH, 1416 U_JG_ALEF, 1417 U_JG_BEH, 1418 U_JG_BETH, 1419 U_JG_DAL, 1420 U_JG_DALATH_RISH, 1421 U_JG_E, 1422 U_JG_FEH, 1423 U_JG_FINAL_SEMKATH, 1424 U_JG_GAF, 1425 U_JG_GAMAL, 1426 U_JG_HAH, 1427 U_JG_HAMZA_ON_HEH_GOAL, 1428 U_JG_HE, 1429 U_JG_HEH, 1430 U_JG_HEH_GOAL, 1431 U_JG_HETH, 1432 U_JG_KAF, 1433 U_JG_KAPH, 1434 U_JG_KNOTTED_HEH, 1435 U_JG_LAM, 1436 U_JG_LAMADH, 1437 U_JG_MEEM, 1438 U_JG_MIM, 1439 U_JG_NOON, 1440 U_JG_NUN, 1441 U_JG_PE, 1442 U_JG_QAF, 1443 U_JG_QAPH, 1444 U_JG_REH, 1445 U_JG_REVERSED_PE, 1446 U_JG_SAD, 1447 U_JG_SADHE, 1448 U_JG_SEEN, 1449 U_JG_SEMKATH, 1450 U_JG_SHIN, 1451 U_JG_SWASH_KAF, 1452 U_JG_SYRIAC_WAW, 1453 U_JG_TAH, 1454 U_JG_TAW, 1455 U_JG_TEH_MARBUTA, 1456 U_JG_TETH, 1457 U_JG_WAW, 1458 U_JG_YEH, 1459 U_JG_YEH_BARREE, 1460 U_JG_YEH_WITH_TAIL, 1461 U_JG_YUDH, 1462 U_JG_YUDH_HE, 1463 U_JG_ZAIN, 1464 U_JG_FE, /**< @stable ICU 2.6 */ 1465 U_JG_KHAPH, /**< @stable ICU 2.6 */ 1466 U_JG_ZHAIN, /**< @stable ICU 2.6 */ 1467 U_JG_BURUSHASKI_YEH_BARREE, /**< @stable ICU 4.0 */ 1468 U_JG_COUNT 1469 } UJoiningGroup; 1470 1471 /** 1472 * Grapheme Cluster Break constants. 1473 * 1474 * @see UCHAR_GRAPHEME_CLUSTER_BREAK 1475 * @stable ICU 3.4 1476 */ 1477 typedef enum UGraphemeClusterBreak { 1478 U_GCB_OTHER = 0, /*[XX]*/ /*See note !!*/ 1479 U_GCB_CONTROL = 1, /*[CN]*/ 1480 U_GCB_CR = 2, /*[CR]*/ 1481 U_GCB_EXTEND = 3, /*[EX]*/ 1482 U_GCB_L = 4, /*[L]*/ 1483 U_GCB_LF = 5, /*[LF]*/ 1484 U_GCB_LV = 6, /*[LV]*/ 1485 U_GCB_LVT = 7, /*[LVT]*/ 1486 U_GCB_T = 8, /*[T]*/ 1487 U_GCB_V = 9, /*[V]*/ 1488 U_GCB_SPACING_MARK = 10, /*[SM]*/ /* from here on: new in Unicode 5.1/ICU 4.0 */ 1489 U_GCB_PREPEND = 11, /*[PP]*/ 1490 U_GCB_COUNT = 12 1491 } UGraphemeClusterBreak; 1492 1493 /** 1494 * Word Break constants. 1495 * (UWordBreak is a pre-existing enum type in ubrk.h for word break status tags.) 1496 * 1497 * @see UCHAR_WORD_BREAK 1498 * @stable ICU 3.4 1499 */ 1500 typedef enum UWordBreakValues { 1501 U_WB_OTHER = 0, /*[XX]*/ /*See note !!*/ 1502 U_WB_ALETTER = 1, /*[LE]*/ 1503 U_WB_FORMAT = 2, /*[FO]*/ 1504 U_WB_KATAKANA = 3, /*[KA]*/ 1505 U_WB_MIDLETTER = 4, /*[ML]*/ 1506 U_WB_MIDNUM = 5, /*[MN]*/ 1507 U_WB_NUMERIC = 6, /*[NU]*/ 1508 U_WB_EXTENDNUMLET = 7, /*[EX]*/ 1509 U_WB_CR = 8, /*[CR]*/ /* from here on: new in Unicode 5.1/ICU 4.0 */ 1510 U_WB_EXTEND = 9, /*[Extend]*/ 1511 U_WB_LF = 10, /*[LF]*/ 1512 U_WB_MIDNUMLET =11, /*[MB]*/ 1513 U_WB_NEWLINE =12, /*[NL]*/ 1514 U_WB_COUNT = 13 1515 } UWordBreakValues; 1516 1517 /** 1518 * Sentence Break constants. 1519 * 1520 * @see UCHAR_SENTENCE_BREAK 1521 * @stable ICU 3.4 1522 */ 1523 typedef enum USentenceBreak { 1524 U_SB_OTHER = 0, /*[XX]*/ /*See note !!*/ 1525 U_SB_ATERM = 1, /*[AT]*/ 1526 U_SB_CLOSE = 2, /*[CL]*/ 1527 U_SB_FORMAT = 3, /*[FO]*/ 1528 U_SB_LOWER = 4, /*[LO]*/ 1529 U_SB_NUMERIC = 5, /*[NU]*/ 1530 U_SB_OLETTER = 6, /*[LE]*/ 1531 U_SB_SEP = 7, /*[SE]*/ 1532 U_SB_SP = 8, /*[SP]*/ 1533 U_SB_STERM = 9, /*[ST]*/ 1534 U_SB_UPPER = 10, /*[UP]*/ 1535 U_SB_CR = 11, /*[CR]*/ /* from here on: new in Unicode 5.1/ICU 4.0 */ 1536 U_SB_EXTEND = 12, /*[EX]*/ 1537 U_SB_LF = 13, /*[LF]*/ 1538 U_SB_SCONTINUE = 14, /*[SC]*/ 1539 U_SB_COUNT = 15 1540 } USentenceBreak; 1541 1542 /** 1543 * Line Break constants. 1544 * 1545 * @see UCHAR_LINE_BREAK 1546 * @stable ICU 2.2 1547 */ 1548 typedef enum ULineBreak { 1549 U_LB_UNKNOWN = 0, /*[XX]*/ /*See note !!*/ 1550 U_LB_AMBIGUOUS = 1, /*[AI]*/ 1551 U_LB_ALPHABETIC = 2, /*[AL]*/ 1552 U_LB_BREAK_BOTH = 3, /*[B2]*/ 1553 U_LB_BREAK_AFTER = 4, /*[BA]*/ 1554 U_LB_BREAK_BEFORE = 5, /*[BB]*/ 1555 U_LB_MANDATORY_BREAK = 6, /*[BK]*/ 1556 U_LB_CONTINGENT_BREAK = 7, /*[CB]*/ 1557 U_LB_CLOSE_PUNCTUATION = 8, /*[CL]*/ 1558 U_LB_COMBINING_MARK = 9, /*[CM]*/ 1559 U_LB_CARRIAGE_RETURN = 10, /*[CR]*/ 1560 U_LB_EXCLAMATION = 11, /*[EX]*/ 1561 U_LB_GLUE = 12, /*[GL]*/ 1562 U_LB_HYPHEN = 13, /*[HY]*/ 1563 U_LB_IDEOGRAPHIC = 14, /*[ID]*/ 1564 U_LB_INSEPERABLE = 15, 1565 /** Renamed from the misspelled "inseperable" in Unicode 4.0.1/ICU 3.0 @stable ICU 3.0 */ 1566 U_LB_INSEPARABLE=U_LB_INSEPERABLE,/*[IN]*/ 1567 U_LB_INFIX_NUMERIC = 16, /*[IS]*/ 1568 U_LB_LINE_FEED = 17, /*[LF]*/ 1569 U_LB_NONSTARTER = 18, /*[NS]*/ 1570 U_LB_NUMERIC = 19, /*[NU]*/ 1571 U_LB_OPEN_PUNCTUATION = 20, /*[OP]*/ 1572 U_LB_POSTFIX_NUMERIC = 21, /*[PO]*/ 1573 U_LB_PREFIX_NUMERIC = 22, /*[PR]*/ 1574 U_LB_QUOTATION = 23, /*[QU]*/ 1575 U_LB_COMPLEX_CONTEXT = 24, /*[SA]*/ 1576 U_LB_SURROGATE = 25, /*[SG]*/ 1577 U_LB_SPACE = 26, /*[SP]*/ 1578 U_LB_BREAK_SYMBOLS = 27, /*[SY]*/ 1579 U_LB_ZWSPACE = 28, /*[ZW]*/ 1580 U_LB_NEXT_LINE = 29, /*[NL]*/ /* from here on: new in Unicode 4/ICU 2.6 */ 1581 U_LB_WORD_JOINER = 30, /*[WJ]*/ 1582 U_LB_H2 = 31, /*[H2]*/ /* from here on: new in Unicode 4.1/ICU 3.4 */ 1583 U_LB_H3 = 32, /*[H3]*/ 1584 U_LB_JL = 33, /*[JL]*/ 1585 U_LB_JT = 34, /*[JT]*/ 1586 U_LB_JV = 35, /*[JV]*/ 1587 U_LB_COUNT = 36 1588 } ULineBreak; 1589 1590 /** 1591 * Numeric Type constants. 1592 * 1593 * @see UCHAR_NUMERIC_TYPE 1594 * @stable ICU 2.2 1595 */ 1596 typedef enum UNumericType { 1597 U_NT_NONE, /*[None]*/ /*See note !!*/ 1598 U_NT_DECIMAL, /*[de]*/ 1599 U_NT_DIGIT, /*[di]*/ 1600 U_NT_NUMERIC, /*[nu]*/ 1601 U_NT_COUNT 1602 } UNumericType; 1603 1604 /** 1605 * Hangul Syllable Type constants. 1606 * 1607 * @see UCHAR_HANGUL_SYLLABLE_TYPE 1608 * @stable ICU 2.6 1609 */ 1610 typedef enum UHangulSyllableType { 1611 U_HST_NOT_APPLICABLE, /*[NA]*/ /*See note !!*/ 1612 U_HST_LEADING_JAMO, /*[L]*/ 1613 U_HST_VOWEL_JAMO, /*[V]*/ 1614 U_HST_TRAILING_JAMO, /*[T]*/ 1615 U_HST_LV_SYLLABLE, /*[LV]*/ 1616 U_HST_LVT_SYLLABLE, /*[LVT]*/ 1617 U_HST_COUNT 1618 } UHangulSyllableType; 1619 1620 /** 1621 * Check a binary Unicode property for a code point. 1622 * 1623 * Unicode, especially in version 3.2, defines many more properties than the 1624 * original set in UnicodeData.txt. 1625 * 1626 * The properties APIs are intended to reflect Unicode properties as defined 1627 * in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR). 1628 * For details about the properties see http://www.unicode.org/ucd/ . 1629 * For names of Unicode properties see the UCD file PropertyAliases.txt. 1630 * 1631 * Important: If ICU is built with UCD files from Unicode versions below 3.2, 1632 * then properties marked with "new in Unicode 3.2" are not or not fully available. 1633 * 1634 * @param c Code point to test. 1635 * @param which UProperty selector constant, identifies which binary property to check. 1636 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT. 1637 * @return TRUE or FALSE according to the binary Unicode property value for c. 1638 * Also FALSE if 'which' is out of bounds or if the Unicode version 1639 * does not have data for the property at all, or not for this code point. 1640 * 1641 * @see UProperty 1642 * @see u_getIntPropertyValue 1643 * @see u_getUnicodeVersion 1644 * @stable ICU 2.1 1645 */ 1646 U_STABLE UBool U_EXPORT2 1647 u_hasBinaryProperty(UChar32 c, UProperty which); 1648 1649 /** 1650 * Check if a code point has the Alphabetic Unicode property. 1651 * Same as u_hasBinaryProperty(c, UCHAR_ALPHABETIC). 1652 * This is different from u_isalpha! 1653 * @param c Code point to test 1654 * @return true if the code point has the Alphabetic Unicode property, false otherwise 1655 * 1656 * @see UCHAR_ALPHABETIC 1657 * @see u_isalpha 1658 * @see u_hasBinaryProperty 1659 * @stable ICU 2.1 1660 */ 1661 U_STABLE UBool U_EXPORT2 1662 u_isUAlphabetic(UChar32 c); 1663 1664 /** 1665 * Check if a code point has the Lowercase Unicode property. 1666 * Same as u_hasBinaryProperty(c, UCHAR_LOWERCASE). 1667 * This is different from u_islower! 1668 * @param c Code point to test 1669 * @return true if the code point has the Lowercase Unicode property, false otherwise 1670 * 1671 * @see UCHAR_LOWERCASE 1672 * @see u_islower 1673 * @see u_hasBinaryProperty 1674 * @stable ICU 2.1 1675 */ 1676 U_STABLE UBool U_EXPORT2 1677 u_isULowercase(UChar32 c); 1678 1679 /** 1680 * Check if a code point has the Uppercase Unicode property. 1681 * Same as u_hasBinaryProperty(c, UCHAR_UPPERCASE). 1682 * This is different from u_isupper! 1683 * @param c Code point to test 1684 * @return true if the code point has the Uppercase Unicode property, false otherwise 1685 * 1686 * @see UCHAR_UPPERCASE 1687 * @see u_isupper 1688 * @see u_hasBinaryProperty 1689 * @stable ICU 2.1 1690 */ 1691 U_STABLE UBool U_EXPORT2 1692 u_isUUppercase(UChar32 c); 1693 1694 /** 1695 * Check if a code point has the White_Space Unicode property. 1696 * Same as u_hasBinaryProperty(c, UCHAR_WHITE_SPACE). 1697 * This is different from both u_isspace and u_isWhitespace! 1698 * 1699 * Note: There are several ICU whitespace functions; please see the uchar.h 1700 * file documentation for a detailed comparison. 1701 * 1702 * @param c Code point to test 1703 * @return true if the code point has the White_Space Unicode property, false otherwise. 1704 * 1705 * @see UCHAR_WHITE_SPACE 1706 * @see u_isWhitespace 1707 * @see u_isspace 1708 * @see u_isJavaSpaceChar 1709 * @see u_hasBinaryProperty 1710 * @stable ICU 2.1 1711 */ 1712 U_STABLE UBool U_EXPORT2 1713 u_isUWhiteSpace(UChar32 c); 1714 1715 /** 1716 * Get the property value for an enumerated or integer Unicode property for a code point. 1717 * Also returns binary and mask property values. 1718 * 1719 * Unicode, especially in version 3.2, defines many more properties than the 1720 * original set in UnicodeData.txt. 1721 * 1722 * The properties APIs are intended to reflect Unicode properties as defined 1723 * in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR). 1724 * For details about the properties see http://www.unicode.org/ . 1725 * For names of Unicode properties see the UCD file PropertyAliases.txt. 1726 * 1727 * Sample usage: 1728 * UEastAsianWidth ea=(UEastAsianWidth)u_getIntPropertyValue(c, UCHAR_EAST_ASIAN_WIDTH); 1729 * UBool b=(UBool)u_getIntPropertyValue(c, UCHAR_IDEOGRAPHIC); 1730 * 1731 * @param c Code point to test. 1732 * @param which UProperty selector constant, identifies which property to check. 1733 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT 1734 * or UCHAR_INT_START<=which<UCHAR_INT_LIMIT 1735 * or UCHAR_MASK_START<=which<UCHAR_MASK_LIMIT. 1736 * @return Numeric value that is directly the property value or, 1737 * for enumerated properties, corresponds to the numeric value of the enumerated 1738 * constant of the respective property value enumeration type 1739 * (cast to enum type if necessary). 1740 * Returns 0 or 1 (for FALSE/TRUE) for binary Unicode properties. 1741 * Returns a bit-mask for mask properties. 1742 * Returns 0 if 'which' is out of bounds or if the Unicode version 1743 * does not have data for the property at all, or not for this code point. 1744 * 1745 * @see UProperty 1746 * @see u_hasBinaryProperty 1747 * @see u_getIntPropertyMinValue 1748 * @see u_getIntPropertyMaxValue 1749 * @see u_getUnicodeVersion 1750 * @stable ICU 2.2 1751 */ 1752 U_STABLE int32_t U_EXPORT2 1753 u_getIntPropertyValue(UChar32 c, UProperty which); 1754 1755 /** 1756 * Get the minimum value for an enumerated/integer/binary Unicode property. 1757 * Can be used together with u_getIntPropertyMaxValue 1758 * to allocate arrays of UnicodeSet or similar. 1759 * 1760 * @param which UProperty selector constant, identifies which binary property to check. 1761 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT 1762 * or UCHAR_INT_START<=which<UCHAR_INT_LIMIT. 1763 * @return Minimum value returned by u_getIntPropertyValue for a Unicode property. 1764 * 0 if the property selector is out of range. 1765 * 1766 * @see UProperty 1767 * @see u_hasBinaryProperty 1768 * @see u_getUnicodeVersion 1769 * @see u_getIntPropertyMaxValue 1770 * @see u_getIntPropertyValue 1771 * @stable ICU 2.2 1772 */ 1773 U_STABLE int32_t U_EXPORT2 1774 u_getIntPropertyMinValue(UProperty which); 1775 1776 /** 1777 * Get the maximum value for an enumerated/integer/binary Unicode property. 1778 * Can be used together with u_getIntPropertyMinValue 1779 * to allocate arrays of UnicodeSet or similar. 1780 * 1781 * Examples for min/max values (for Unicode 3.2): 1782 * 1783 * - UCHAR_BIDI_CLASS: 0/18 (U_LEFT_TO_RIGHT/U_BOUNDARY_NEUTRAL) 1784 * - UCHAR_SCRIPT: 0/45 (USCRIPT_COMMON/USCRIPT_TAGBANWA) 1785 * - UCHAR_IDEOGRAPHIC: 0/1 (FALSE/TRUE) 1786 * 1787 * For undefined UProperty constant values, min/max values will be 0/-1. 1788 * 1789 * @param which UProperty selector constant, identifies which binary property to check. 1790 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT 1791 * or UCHAR_INT_START<=which<UCHAR_INT_LIMIT. 1792 * @return Maximum value returned by u_getIntPropertyValue for a Unicode property. 1793 * <=0 if the property selector is out of range. 1794 * 1795 * @see UProperty 1796 * @see u_hasBinaryProperty 1797 * @see u_getUnicodeVersion 1798 * @see u_getIntPropertyMaxValue 1799 * @see u_getIntPropertyValue 1800 * @stable ICU 2.2 1801 */ 1802 U_STABLE int32_t U_EXPORT2 1803 u_getIntPropertyMaxValue(UProperty which); 1804 1805 /** 1806 * Get the numeric value for a Unicode code point as defined in the 1807 * Unicode Character Database. 1808 * 1809 * A "double" return type is necessary because 1810 * some numeric values are fractions, negative, or too large for int32_t. 1811 * 1812 * For characters without any numeric values in the Unicode Character Database, 1813 * this function will return U_NO_NUMERIC_VALUE. 1814 * 1815 * Similar to java.lang.Character.getNumericValue(), but u_getNumericValue() 1816 * also supports negative values, large values, and fractions, 1817 * while Java's getNumericValue() returns values 10..35 for ASCII letters. 1818 * 1819 * @param c Code point to get the numeric value for. 1820 * @return Numeric value of c, or U_NO_NUMERIC_VALUE if none is defined. 1821 * 1822 * @see U_NO_NUMERIC_VALUE 1823 * @stable ICU 2.2 1824 */ 1825 U_STABLE double U_EXPORT2 1826 u_getNumericValue(UChar32 c); 1827 1828 /** 1829 * Special value that is returned by u_getNumericValue when 1830 * no numeric value is defined for a code point. 1831 * 1832 * @see u_getNumericValue 1833 * @stable ICU 2.2 1834 */ 1835 #define U_NO_NUMERIC_VALUE ((double)-123456789.) 1836 1837 /** 1838 * Determines whether the specified code point has the general category "Ll" 1839 * (lowercase letter). 1840 * 1841 * Same as java.lang.Character.isLowerCase(). 1842 * 1843 * This misses some characters that are also lowercase but 1844 * have a different general category value. 1845 * In order to include those, use UCHAR_LOWERCASE. 1846 * 1847 * In addition to being equivalent to a Java function, this also serves 1848 * as a C/POSIX migration function. 1849 * See the comments about C/POSIX character classification functions in the 1850 * documentation at the top of this header file. 1851 * 1852 * @param c the code point to be tested 1853 * @return TRUE if the code point is an Ll lowercase letter 1854 * 1855 * @see UCHAR_LOWERCASE 1856 * @see u_isupper 1857 * @see u_istitle 1858 * @stable ICU 2.0 1859 */ 1860 U_STABLE UBool U_EXPORT2 1861 u_islower(UChar32 c); 1862 1863 /** 1864 * Determines whether the specified code point has the general category "Lu" 1865 * (uppercase letter). 1866 * 1867 * Same as java.lang.Character.isUpperCase(). 1868 * 1869 * This misses some characters that are also uppercase but 1870 * have a different general category value. 1871 * In order to include those, use UCHAR_UPPERCASE. 1872 * 1873 * In addition to being equivalent to a Java function, this also serves 1874 * as a C/POSIX migration function. 1875 * See the comments about C/POSIX character classification functions in the 1876 * documentation at the top of this header file. 1877 * 1878 * @param c the code point to be tested 1879 * @return TRUE if the code point is an Lu uppercase letter 1880 * 1881 * @see UCHAR_UPPERCASE 1882 * @see u_islower 1883 * @see u_istitle 1884 * @see u_tolower 1885 * @stable ICU 2.0 1886 */ 1887 U_STABLE UBool U_EXPORT2 1888 u_isupper(UChar32 c); 1889 1890 /** 1891 * Determines whether the specified code point is a titlecase letter. 1892 * True for general category "Lt" (titlecase letter). 1893 * 1894 * Same as java.lang.Character.isTitleCase(). 1895 * 1896 * @param c the code point to be tested 1897 * @return TRUE if the code point is an Lt titlecase letter 1898 * 1899 * @see u_isupper 1900 * @see u_islower 1901 * @see u_totitle 1902 * @stable ICU 2.0 1903 */ 1904 U_STABLE UBool U_EXPORT2 1905 u_istitle(UChar32 c); 1906 1907 /** 1908 * Determines whether the specified code point is a digit character according to Java. 1909 * True for characters with general category "Nd" (decimal digit numbers). 1910 * Beginning with Unicode 4, this is the same as 1911 * testing for the Numeric_Type of Decimal. 1912 * 1913 * Same as java.lang.Character.isDigit(). 1914 * 1915 * In addition to being equivalent to a Java function, this also serves 1916 * as a C/POSIX migration function. 1917 * See the comments about C/POSIX character classification functions in the 1918 * documentation at the top of this header file. 1919 * 1920 * @param c the code point to be tested 1921 * @return TRUE if the code point is a digit character according to Character.isDigit() 1922 * 1923 * @stable ICU 2.0 1924 */ 1925 U_STABLE UBool U_EXPORT2 1926 u_isdigit(UChar32 c); 1927 1928 /** 1929 * Determines whether the specified code point is a letter character. 1930 * True for general categories "L" (letters). 1931 * 1932 * Same as java.lang.Character.isLetter(). 1933 * 1934 * In addition to being equivalent to a Java function, this also serves 1935 * as a C/POSIX migration function. 1936 * See the comments about C/POSIX character classification functions in the 1937 * documentation at the top of this header file. 1938 * 1939 * @param c the code point to be tested 1940 * @return TRUE if the code point is a letter character 1941 * 1942 * @see u_isdigit 1943 * @see u_isalnum 1944 * @stable ICU 2.0 1945 */ 1946 U_STABLE UBool U_EXPORT2 1947 u_isalpha(UChar32 c); 1948 1949 /** 1950 * Determines whether the specified code point is an alphanumeric character 1951 * (letter or digit) according to Java. 1952 * True for characters with general categories 1953 * "L" (letters) and "Nd" (decimal digit numbers). 1954 * 1955 * Same as java.lang.Character.isLetterOrDigit(). 1956 * 1957 * In addition to being equivalent to a Java function, this also serves 1958 * as a C/POSIX migration function. 1959 * See the comments about C/POSIX character classification functions in the 1960 * documentation at the top of this header file. 1961 * 1962 * @param c the code point to be tested 1963 * @return TRUE if the code point is an alphanumeric character according to Character.isLetterOrDigit() 1964 * 1965 * @stable ICU 2.0 1966 */ 1967 U_STABLE UBool U_EXPORT2 1968 u_isalnum(UChar32 c); 1969 1970 /** 1971 * Determines whether the specified code point is a hexadecimal digit. 1972 * This is equivalent to u_digit(c, 16)>=0. 1973 * True for characters with general category "Nd" (decimal digit numbers) 1974 * as well as Latin letters a-f and A-F in both ASCII and Fullwidth ASCII. 1975 * (That is, for letters with code points 1976 * 0041..0046, 0061..0066, FF21..FF26, FF41..FF46.) 1977 * 1978 * In order to narrow the definition of hexadecimal digits to only ASCII 1979 * characters, use (c<=0x7f && u_isxdigit(c)). 1980 * 1981 * This is a C/POSIX migration function. 1982 * See the comments about C/POSIX character classification functions in the 1983 * documentation at the top of this header file. 1984 * 1985 * @param c the code point to be tested 1986 * @return TRUE if the code point is a hexadecimal digit 1987 * 1988 * @stable ICU 2.6 1989 */ 1990 U_STABLE UBool U_EXPORT2 1991 u_isxdigit(UChar32 c); 1992 1993 /** 1994 * Determines whether the specified code point is a punctuation character. 1995 * True for characters with general categories "P" (punctuation). 1996 * 1997 * This is a C/POSIX migration function. 1998 * See the comments about C/POSIX character classification functions in the 1999 * documentation at the top of this header file. 2000 * 2001 * @param c the code point to be tested 2002 * @return TRUE if the code point is a punctuation character 2003 * 2004 * @stable ICU 2.6 2005 */ 2006 U_STABLE UBool U_EXPORT2 2007 u_ispunct(UChar32 c); 2008 2009 /** 2010 * Determines whether the specified code point is a "graphic" character 2011 * (printable, excluding spaces). 2012 * TRUE for all characters except those with general categories 2013 * "Cc" (control codes), "Cf" (format controls), "Cs" (surrogates), 2014 * "Cn" (unassigned), and "Z" (separators). 2015 * 2016 * This is a C/POSIX migration function. 2017 * See the comments about C/POSIX character classification functions in the 2018 * documentation at the top of this header file. 2019 * 2020 * @param c the code point to be tested 2021 * @return TRUE if the code point is a "graphic" character 2022 * 2023 * @stable ICU 2.6 2024 */ 2025 U_STABLE UBool U_EXPORT2 2026 u_isgraph(UChar32 c); 2027 2028 /** 2029 * Determines whether the specified code point is a "blank" or "horizontal space", 2030 * a character that visibly separates words on a line. 2031 * The following are equivalent definitions: 2032 * 2033 * TRUE for Unicode White_Space characters except for "vertical space controls" 2034 * where "vertical space controls" are the following characters: 2035 * U+000A (LF) U+000B (VT) U+000C (FF) U+000D (CR) U+0085 (NEL) U+2028 (LS) U+2029 (PS) 2036 * 2037 * same as 2038 * 2039 * TRUE for U+0009 (TAB) and characters with general category "Zs" (space separators) 2040 * except Zero Width Space (ZWSP, U+200B). 2041 * 2042 * Note: There are several ICU whitespace functions; please see the uchar.h 2043 * file documentation for a detailed comparison. 2044 * 2045 * This is a C/POSIX migration function. 2046 * See the comments about C/POSIX character classification functions in the 2047 * documentation at the top of this header file. 2048 * 2049 * @param c the code point to be tested 2050 * @return TRUE if the code point is a "blank" 2051 * 2052 * @stable ICU 2.6 2053 */ 2054 U_STABLE UBool U_EXPORT2 2055 u_isblank(UChar32 c); 2056 2057 /** 2058 * Determines whether the specified code point is "defined", 2059 * which usually means that it is assigned a character. 2060 * True for general categories other than "Cn" (other, not assigned), 2061 * i.e., true for all code points mentioned in UnicodeData.txt. 2062 * 2063 * Note that non-character code points (e.g., U+FDD0) are not "defined" 2064 * (they are Cn), but surrogate code points are "defined" (Cs). 2065 * 2066 * Same as java.lang.Character.isDefined(). 2067 * 2068 * @param c the code point to be tested 2069 * @return TRUE if the code point is assigned a character 2070 * 2071 * @see u_isdigit 2072 * @see u_isalpha 2073 * @see u_isalnum 2074 * @see u_isupper 2075 * @see u_islower 2076 * @see u_istitle 2077 * @stable ICU 2.0 2078 */ 2079 U_STABLE UBool U_EXPORT2 2080 u_isdefined(UChar32 c); 2081 2082 /** 2083 * Determines if the specified character is a space character or not. 2084 * 2085 * Note: There are several ICU whitespace functions; please see the uchar.h 2086 * file documentation for a detailed comparison. 2087 * 2088 * This is a C/POSIX migration function. 2089 * See the comments about C/POSIX character classification functions in the 2090 * documentation at the top of this header file. 2091 * 2092 * @param c the character to be tested 2093 * @return true if the character is a space character; false otherwise. 2094 * 2095 * @see u_isJavaSpaceChar 2096 * @see u_isWhitespace 2097 * @see u_isUWhiteSpace 2098 * @stable ICU 2.0 2099 */ 2100 U_STABLE UBool U_EXPORT2 2101 u_isspace(UChar32 c); 2102 2103 /** 2104 * Determine if the specified code point is a space character according to Java. 2105 * True for characters with general categories "Z" (separators), 2106 * which does not include control codes (e.g., TAB or Line Feed). 2107 * 2108 * Same as java.lang.Character.isSpaceChar(). 2109 * 2110 * Note: There are several ICU whitespace functions; please see the uchar.h 2111 * file documentation for a detailed comparison. 2112 * 2113 * @param c the code point to be tested 2114 * @return TRUE if the code point is a space character according to Character.isSpaceChar() 2115 * 2116 * @see u_isspace 2117 * @see u_isWhitespace 2118 * @see u_isUWhiteSpace 2119 * @stable ICU 2.6 2120 */ 2121 U_STABLE UBool U_EXPORT2 2122 u_isJavaSpaceChar(UChar32 c); 2123 2124 /** 2125 * Determines if the specified code point is a whitespace character according to Java/ICU. 2126 * A character is considered to be a Java whitespace character if and only 2127 * if it satisfies one of the following criteria: 2128 * 2129 * - It is a Unicode separator (categories "Z"), but is not 2130 * a no-break space (U+00A0 NBSP or U+2007 Figure Space or U+202F Narrow NBSP). 2131 * - It is U+0009 HORIZONTAL TABULATION. 2132 * - It is U+000A LINE FEED. 2133 * - It is U+000B VERTICAL TABULATION. 2134 * - It is U+000C FORM FEED. 2135 * - It is U+000D CARRIAGE RETURN. 2136 * - It is U+001C FILE SEPARATOR. 2137 * - It is U+001D GROUP SEPARATOR. 2138 * - It is U+001E RECORD SEPARATOR. 2139 * - It is U+001F UNIT SEPARATOR. 2140 * - It is U+0085 NEXT LINE. 2141 * 2142 * Same as java.lang.Character.isWhitespace() except that Java omits U+0085. 2143 * 2144 * Note: There are several ICU whitespace functions; please see the uchar.h 2145 * file documentation for a detailed comparison. 2146 * 2147 * @param c the code point to be tested 2148 * @return TRUE if the code point is a whitespace character according to Java/ICU 2149 * 2150 * @see u_isspace 2151 * @see u_isJavaSpaceChar 2152 * @see u_isUWhiteSpace 2153 * @stable ICU 2.0 2154 */ 2155 U_STABLE UBool U_EXPORT2 2156 u_isWhitespace(UChar32 c); 2157 2158 /** 2159 * Determines whether the specified code point is a control character 2160 * (as defined by this function). 2161 * A control character is one of the following: 2162 * - ISO 8-bit control character (U+0000..U+001f and U+007f..U+009f) 2163 * - U_CONTROL_CHAR (Cc) 2164 * - U_FORMAT_CHAR (Cf) 2165 * - U_LINE_SEPARATOR (Zl) 2166 * - U_PARAGRAPH_SEPARATOR (Zp) 2167 * 2168 * This is a C/POSIX migration function. 2169 * See the comments about C/POSIX character classification functions in the 2170 * documentation at the top of this header file. 2171 * 2172 * @param c the code point to be tested 2173 * @return TRUE if the code point is a control character 2174 * 2175 * @see UCHAR_DEFAULT_IGNORABLE_CODE_POINT 2176 * @see u_isprint 2177 * @stable ICU 2.0 2178 */ 2179 U_STABLE UBool U_EXPORT2 2180 u_iscntrl(UChar32 c); 2181 2182 /** 2183 * Determines whether the specified code point is an ISO control code. 2184 * True for U+0000..U+001f and U+007f..U+009f (general category "Cc"). 2185 * 2186 * Same as java.lang.Character.isISOControl(). 2187 * 2188 * @param c the code point to be tested 2189 * @return TRUE if the code point is an ISO control code 2190 * 2191 * @see u_iscntrl 2192 * @stable ICU 2.6 2193 */ 2194 U_STABLE UBool U_EXPORT2 2195 u_isISOControl(UChar32 c); 2196 2197 /** 2198 * Determines whether the specified code point is a printable character. 2199 * True for general categories <em>other</em> than "C" (controls). 2200 * 2201 * This is a C/POSIX migration function. 2202 * See the comments about C/POSIX character classification functions in the 2203 * documentation at the top of this header file. 2204 * 2205 * @param c the code point to be tested 2206 * @return TRUE if the code point is a printable character 2207 * 2208 * @see UCHAR_DEFAULT_IGNORABLE_CODE_POINT 2209 * @see u_iscntrl 2210 * @stable ICU 2.0 2211 */ 2212 U_STABLE UBool U_EXPORT2 2213 u_isprint(UChar32 c); 2214 2215 /** 2216 * Determines whether the specified code point is a base character. 2217 * True for general categories "L" (letters), "N" (numbers), 2218 * "Mc" (spacing combining marks), and "Me" (enclosing marks). 2219 * 2220 * Note that this is different from the Unicode definition in 2221 * chapter 3.5, conformance clause D13, 2222 * which defines base characters to be all characters (not Cn) 2223 * that do not graphically combine with preceding characters (M) 2224 * and that are neither control (Cc) or format (Cf) characters. 2225 * 2226 * @param c the code point to be tested 2227 * @return TRUE if the code point is a base character according to this function 2228 * 2229 * @see u_isalpha 2230 * @see u_isdigit 2231 * @stable ICU 2.0 2232 */ 2233 U_STABLE UBool U_EXPORT2 2234 u_isbase(UChar32 c); 2235 2236 /** 2237 * Returns the bidirectional category value for the code point, 2238 * which is used in the Unicode bidirectional algorithm 2239 * (UAX #9 http://www.unicode.org/reports/tr9/). 2240 * Note that some <em>unassigned</em> code points have bidi values 2241 * of R or AL because they are in blocks that are reserved 2242 * for Right-To-Left scripts. 2243 * 2244 * Same as java.lang.Character.getDirectionality() 2245 * 2246 * @param c the code point to be tested 2247 * @return the bidirectional category (UCharDirection) value 2248 * 2249 * @see UCharDirection 2250 * @stable ICU 2.0 2251 */ 2252 U_STABLE UCharDirection U_EXPORT2 2253 u_charDirection(UChar32 c); 2254 2255 /** 2256 * Determines whether the code point has the Bidi_Mirrored property. 2257 * This property is set for characters that are commonly used in 2258 * Right-To-Left contexts and need to be displayed with a "mirrored" 2259 * glyph. 2260 * 2261 * Same as java.lang.Character.isMirrored(). 2262 * Same as UCHAR_BIDI_MIRRORED 2263 * 2264 * @param c the code point to be tested 2265 * @return TRUE if the character has the Bidi_Mirrored property 2266 * 2267 * @see UCHAR_BIDI_MIRRORED 2268 * @stable ICU 2.0 2269 */ 2270 U_STABLE UBool U_EXPORT2 2271 u_isMirrored(UChar32 c); 2272 2273 /** 2274 * Maps the specified character to a "mirror-image" character. 2275 * For characters with the Bidi_Mirrored property, implementations 2276 * sometimes need a "poor man's" mapping to another Unicode 2277 * character (code point) such that the default glyph may serve 2278 * as the mirror-image of the default glyph of the specified 2279 * character. This is useful for text conversion to and from 2280 * codepages with visual order, and for displays without glyph 2281 * selecetion capabilities. 2282 * 2283 * @param c the code point to be mapped 2284 * @return another Unicode code point that may serve as a mirror-image 2285 * substitute, or c itself if there is no such mapping or c 2286 * does not have the Bidi_Mirrored property 2287 * 2288 * @see UCHAR_BIDI_MIRRORED 2289 * @see u_isMirrored 2290 * @stable ICU 2.0 2291 */ 2292 U_STABLE UChar32 U_EXPORT2 2293 u_charMirror(UChar32 c); 2294 2295 /** 2296 * Returns the general category value for the code point. 2297 * 2298 * Same as java.lang.Character.getType(). 2299 * 2300 * @param c the code point to be tested 2301 * @return the general category (UCharCategory) value 2302 * 2303 * @see UCharCategory 2304 * @stable ICU 2.0 2305 */ 2306 U_STABLE int8_t U_EXPORT2 2307 u_charType(UChar32 c); 2308 2309 /** 2310 * Get a single-bit bit set for the general category of a character. 2311 * This bit set can be compared bitwise with U_GC_SM_MASK, U_GC_L_MASK, etc. 2312 * Same as U_MASK(u_charType(c)). 2313 * 2314 * @param c the code point to be tested 2315 * @return a single-bit mask corresponding to the general category (UCharCategory) value 2316 * 2317 * @see u_charType 2318 * @see UCharCategory 2319 * @see U_GC_CN_MASK 2320 * @stable ICU 2.1 2321 */ 2322 #define U_GET_GC_MASK(c) U_MASK(u_charType(c)) 2323 2324 /** 2325 * Callback from u_enumCharTypes(), is called for each contiguous range 2326 * of code points c (where start<=c<limit) 2327 * with the same Unicode general category ("character type"). 2328 * 2329 * The callback function can stop the enumeration by returning FALSE. 2330 * 2331 * @param context an opaque pointer, as passed into utrie_enum() 2332 * @param start the first code point in a contiguous range with value 2333 * @param limit one past the last code point in a contiguous range with value 2334 * @param type the general category for all code points in [start..limit[ 2335 * @return FALSE to stop the enumeration 2336 * 2337 * @stable ICU 2.1 2338 * @see UCharCategory 2339 * @see u_enumCharTypes 2340 */ 2341 typedef UBool U_CALLCONV 2342 UCharEnumTypeRange(const void *context, UChar32 start, UChar32 limit, UCharCategory type); 2343 2344 /** 2345 * Enumerate efficiently all code points with their Unicode general categories. 2346 * 2347 * This is useful for building data structures (e.g., UnicodeSet's), 2348 * for enumerating all assigned code points (type!=U_UNASSIGNED), etc. 2349 * 2350 * For each contiguous range of code points with a given general category ("character type"), 2351 * the UCharEnumTypeRange function is called. 2352 * Adjacent ranges have different types. 2353 * The Unicode Standard guarantees that the numeric value of the type is 0..31. 2354 * 2355 * @param enumRange a pointer to a function that is called for each contiguous range 2356 * of code points with the same general category 2357 * @param context an opaque pointer that is passed on to the callback function 2358 * 2359 * @stable ICU 2.1 2360 * @see UCharCategory 2361 * @see UCharEnumTypeRange 2362 */ 2363 U_STABLE void U_EXPORT2 2364 u_enumCharTypes(UCharEnumTypeRange *enumRange, const void *context); 2365 2366 #if !UCONFIG_NO_NORMALIZATION 2367 2368 /** 2369 * Returns the combining class of the code point as specified in UnicodeData.txt. 2370 * 2371 * @param c the code point of the character 2372 * @return the combining class of the character 2373 * @stable ICU 2.0 2374 */ 2375 U_STABLE uint8_t U_EXPORT2 2376 u_getCombiningClass(UChar32 c); 2377 2378 #endif 2379 2380 /** 2381 * Returns the decimal digit value of a decimal digit character. 2382 * Such characters have the general category "Nd" (decimal digit numbers) 2383 * and a Numeric_Type of Decimal. 2384 * 2385 * Unlike ICU releases before 2.6, no digit values are returned for any 2386 * Han characters because Han number characters are often used with a special 2387 * Chinese-style number format (with characters for powers of 10 in between) 2388 * instead of in decimal-positional notation. 2389 * Unicode 4 explicitly assigns Han number characters the Numeric_Type 2390 * Numeric instead of Decimal. 2391 * See Jitterbug 1483 for more details. 2392 * 2393 * Use u_getIntPropertyValue(c, UCHAR_NUMERIC_TYPE) and u_getNumericValue() 2394 * for complete numeric Unicode properties. 2395 * 2396 * @param c the code point for which to get the decimal digit value 2397 * @return the decimal digit value of c, 2398 * or -1 if c is not a decimal digit character 2399 * 2400 * @see u_getNumericValue 2401 * @stable ICU 2.0 2402 */ 2403 U_STABLE int32_t U_EXPORT2 2404 u_charDigitValue(UChar32 c); 2405 2406 /** 2407 * Returns the Unicode allocation block that contains the character. 2408 * 2409 * @param c the code point to be tested 2410 * @return the block value (UBlockCode) for c 2411 * 2412 * @see UBlockCode 2413 * @stable ICU 2.0 2414 */ 2415 U_STABLE UBlockCode U_EXPORT2 2416 ublock_getCode(UChar32 c); 2417 2418 /** 2419 * Retrieve the name of a Unicode character. 2420 * Depending on <code>nameChoice</code>, the character name written 2421 * into the buffer is the "modern" name or the name that was defined 2422 * in Unicode version 1.0. 2423 * The name contains only "invariant" characters 2424 * like A-Z, 0-9, space, and '-'. 2425 * Unicode 1.0 names are only retrieved if they are different from the modern 2426 * names and if the data file contains the data for them. gennames may or may 2427 * not be called with a command line option to include 1.0 names in unames.dat. 2428 * 2429 * @param code The character (code point) for which to get the name. 2430 * It must be <code>0<=code<=0x10ffff</code>. 2431 * @param nameChoice Selector for which name to get. 2432 * @param buffer Destination address for copying the name. 2433 * The name will always be zero-terminated. 2434 * If there is no name, then the buffer will be set to the empty string. 2435 * @param bufferLength <code>==sizeof(buffer)</code> 2436 * @param pErrorCode Pointer to a UErrorCode variable; 2437 * check for <code>U_SUCCESS()</code> after <code>u_charName()</code> 2438 * returns. 2439 * @return The length of the name, or 0 if there is no name for this character. 2440 * If the bufferLength is less than or equal to the length, then the buffer 2441 * contains the truncated name and the returned length indicates the full 2442 * length of the name. 2443 * The length does not include the zero-termination. 2444 * 2445 * @see UCharNameChoice 2446 * @see u_charFromName 2447 * @see u_enumCharNames 2448 * @stable ICU 2.0 2449 */ 2450 U_STABLE int32_t U_EXPORT2 2451 u_charName(UChar32 code, UCharNameChoice nameChoice, 2452 char *buffer, int32_t bufferLength, 2453 UErrorCode *pErrorCode); 2454 2455 /** 2456 * Get the ISO 10646 comment for a character. 2457 * The ISO 10646 comment is an informative field in the Unicode Character 2458 * Database (UnicodeData.txt field 11) and is from the ISO 10646 names list. 2459 * 2460 * @param c The character (code point) for which to get the ISO comment. 2461 * It must be <code>0<=c<=0x10ffff</code>. 2462 * @param dest Destination address for copying the comment. 2463 * The comment will be zero-terminated if possible. 2464 * If there is no comment, then the buffer will be set to the empty string. 2465 * @param destCapacity <code>==sizeof(dest)</code> 2466 * @param pErrorCode Pointer to a UErrorCode variable; 2467 * check for <code>U_SUCCESS()</code> after <code>u_getISOComment()</code> 2468 * returns. 2469 * @return The length of the comment, or 0 if there is no comment for this character. 2470 * If the destCapacity is less than or equal to the length, then the buffer 2471 * contains the truncated name and the returned length indicates the full 2472 * length of the name. 2473 * The length does not include the zero-termination. 2474 * 2475 * @stable ICU 2.2 2476 */ 2477 U_STABLE int32_t U_EXPORT2 2478 u_getISOComment(UChar32 c, 2479 char *dest, int32_t destCapacity, 2480 UErrorCode *pErrorCode); 2481 2482 /** 2483 * Find a Unicode character by its name and return its code point value. 2484 * The name is matched exactly and completely. 2485 * If the name does not correspond to a code point, <i>pErrorCode</i> 2486 * is set to <code>U_INVALID_CHAR_FOUND</code>. 2487 * A Unicode 1.0 name is matched only if it differs from the modern name. 2488 * Unicode names are all uppercase. Extended names are lowercase followed 2489 * by an uppercase hexadecimal number, and within angle brackets. 2490 * 2491 * @param nameChoice Selector for which name to match. 2492 * @param name The name to match. 2493 * @param pErrorCode Pointer to a UErrorCode variable 2494 * @return The Unicode value of the code point with the given name, 2495 * or an undefined value if there is no such code point. 2496 * 2497 * @see UCharNameChoice 2498 * @see u_charName 2499 * @see u_enumCharNames 2500 * @stable ICU 1.7 2501 */ 2502 U_STABLE UChar32 U_EXPORT2 2503 u_charFromName(UCharNameChoice nameChoice, 2504 const char *name, 2505 UErrorCode *pErrorCode); 2506 2507 /** 2508 * Type of a callback function for u_enumCharNames() that gets called 2509 * for each Unicode character with the code point value and 2510 * the character name. 2511 * If such a function returns FALSE, then the enumeration is stopped. 2512 * 2513 * @param context The context pointer that was passed to u_enumCharNames(). 2514 * @param code The Unicode code point for the character with this name. 2515 * @param nameChoice Selector for which kind of names is enumerated. 2516 * @param name The character's name, zero-terminated. 2517 * @param length The length of the name. 2518 * @return TRUE if the enumeration should continue, FALSE to stop it. 2519 * 2520 * @see UCharNameChoice 2521 * @see u_enumCharNames 2522 * @stable ICU 1.7 2523 */ 2524 typedef UBool U_CALLCONV UEnumCharNamesFn(void *context, 2525 UChar32 code, 2526 UCharNameChoice nameChoice, 2527 const char *name, 2528 int32_t length); 2529 2530 /** 2531 * Enumerate all assigned Unicode characters between the start and limit 2532 * code points (start inclusive, limit exclusive) and call a function 2533 * for each, passing the code point value and the character name. 2534 * For Unicode 1.0 names, only those are enumerated that differ from the 2535 * modern names. 2536 * 2537 * @param start The first code point in the enumeration range. 2538 * @param limit One more than the last code point in the enumeration range 2539 * (the first one after the range). 2540 * @param fn The function that is to be called for each character name. 2541 * @param context An arbitrary pointer that is passed to the function. 2542 * @param nameChoice Selector for which kind of names to enumerate. 2543 * @param pErrorCode Pointer to a UErrorCode variable 2544 * 2545 * @see UCharNameChoice 2546 * @see UEnumCharNamesFn 2547 * @see u_charName 2548 * @see u_charFromName 2549 * @stable ICU 1.7 2550 */ 2551 U_STABLE void U_EXPORT2 2552 u_enumCharNames(UChar32 start, UChar32 limit, 2553 UEnumCharNamesFn *fn, 2554 void *context, 2555 UCharNameChoice nameChoice, 2556 UErrorCode *pErrorCode); 2557 2558 /** 2559 * Return the Unicode name for a given property, as given in the 2560 * Unicode database file PropertyAliases.txt. 2561 * 2562 * In addition, this function maps the property 2563 * UCHAR_GENERAL_CATEGORY_MASK to the synthetic names "gcm" / 2564 * "General_Category_Mask". These names are not in 2565 * PropertyAliases.txt. 2566 * 2567 * @param property UProperty selector other than UCHAR_INVALID_CODE. 2568 * If out of range, NULL is returned. 2569 * 2570 * @param nameChoice selector for which name to get. If out of range, 2571 * NULL is returned. All properties have a long name. Most 2572 * have a short name, but some do not. Unicode allows for 2573 * additional names; if present these will be returned by 2574 * U_LONG_PROPERTY_NAME + i, where i=1, 2,... 2575 * 2576 * @return a pointer to the name, or NULL if either the 2577 * property or the nameChoice is out of range. If a given 2578 * nameChoice returns NULL, then all larger values of 2579 * nameChoice will return NULL, with one exception: if NULL is 2580 * returned for U_SHORT_PROPERTY_NAME, then 2581 * U_LONG_PROPERTY_NAME (and higher) may still return a 2582 * non-NULL value. The returned pointer is valid until 2583 * u_cleanup() is called. 2584 * 2585 * @see UProperty 2586 * @see UPropertyNameChoice 2587 * @stable ICU 2.4 2588 */ 2589 U_STABLE const char* U_EXPORT2 2590 u_getPropertyName(UProperty property, 2591 UPropertyNameChoice nameChoice); 2592 2593 /** 2594 * Return the UProperty enum for a given property name, as specified 2595 * in the Unicode database file PropertyAliases.txt. Short, long, and 2596 * any other variants are recognized. 2597 * 2598 * In addition, this function maps the synthetic names "gcm" / 2599 * "General_Category_Mask" to the property 2600 * UCHAR_GENERAL_CATEGORY_MASK. These names are not in 2601 * PropertyAliases.txt. 2602 * 2603 * @param alias the property name to be matched. The name is compared 2604 * using "loose matching" as described in PropertyAliases.txt. 2605 * 2606 * @return a UProperty enum, or UCHAR_INVALID_CODE if the given name 2607 * does not match any property. 2608 * 2609 * @see UProperty 2610 * @stable ICU 2.4 2611 */ 2612 U_STABLE UProperty U_EXPORT2 2613 u_getPropertyEnum(const char* alias); 2614 2615 /** 2616 * Return the Unicode name for a given property value, as given in the 2617 * Unicode database file PropertyValueAliases.txt. 2618 * 2619 * Note: Some of the names in PropertyValueAliases.txt can only be 2620 * retrieved using UCHAR_GENERAL_CATEGORY_MASK, not 2621 * UCHAR_GENERAL_CATEGORY. These include: "C" / "Other", "L" / 2622 * "Letter", "LC" / "Cased_Letter", "M" / "Mark", "N" / "Number", "P" 2623 * / "Punctuation", "S" / "Symbol", and "Z" / "Separator". 2624 * 2625 * @param property UProperty selector constant. 2626 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT 2627 * or UCHAR_INT_START<=which<UCHAR_INT_LIMIT 2628 * or UCHAR_MASK_START<=which<UCHAR_MASK_LIMIT. 2629 * If out of range, NULL is returned. 2630 * 2631 * @param value selector for a value for the given property. If out 2632 * of range, NULL is returned. In general, valid values range 2633 * from 0 up to some maximum. There are a few exceptions: 2634 * (1.) UCHAR_BLOCK values begin at the non-zero value 2635 * UBLOCK_BASIC_LATIN. (2.) UCHAR_CANONICAL_COMBINING_CLASS 2636 * values are not contiguous and range from 0..240. (3.) 2637 * UCHAR_GENERAL_CATEGORY_MASK values are not values of 2638 * UCharCategory, but rather mask values produced by 2639 * U_GET_GC_MASK(). This allows grouped categories such as 2640 * [:L:] to be represented. Mask values range 2641 * non-contiguously from 1..U_GC_P_MASK. 2642 * 2643 * @param nameChoice selector for which name to get. If out of range, 2644 * NULL is returned. All values have a long name. Most have 2645 * a short name, but some do not. Unicode allows for 2646 * additional names; if present these will be returned by 2647 * U_LONG_PROPERTY_NAME + i, where i=1, 2,... 2648 2649 * @return a pointer to the name, or NULL if either the 2650 * property or the nameChoice is out of range. If a given 2651 * nameChoice returns NULL, then all larger values of 2652 * nameChoice will return NULL, with one exception: if NULL is 2653 * returned for U_SHORT_PROPERTY_NAME, then 2654 * U_LONG_PROPERTY_NAME (and higher) may still return a 2655 * non-NULL value. The returned pointer is valid until 2656 * u_cleanup() is called. 2657 * 2658 * @see UProperty 2659 * @see UPropertyNameChoice 2660 * @stable ICU 2.4 2661 */ 2662 U_STABLE const char* U_EXPORT2 2663 u_getPropertyValueName(UProperty property, 2664 int32_t value, 2665 UPropertyNameChoice nameChoice); 2666 2667 /** 2668 * Return the property value integer for a given value name, as 2669 * specified in the Unicode database file PropertyValueAliases.txt. 2670 * Short, long, and any other variants are recognized. 2671 * 2672 * Note: Some of the names in PropertyValueAliases.txt will only be 2673 * recognized with UCHAR_GENERAL_CATEGORY_MASK, not 2674 * UCHAR_GENERAL_CATEGORY. These include: "C" / "Other", "L" / 2675 * "Letter", "LC" / "Cased_Letter", "M" / "Mark", "N" / "Number", "P" 2676 * / "Punctuation", "S" / "Symbol", and "Z" / "Separator". 2677 * 2678 * @param property UProperty selector constant. 2679 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT 2680 * or UCHAR_INT_START<=which<UCHAR_INT_LIMIT 2681 * or UCHAR_MASK_START<=which<UCHAR_MASK_LIMIT. 2682 * If out of range, UCHAR_INVALID_CODE is returned. 2683 * 2684 * @param alias the value name to be matched. The name is compared 2685 * using "loose matching" as described in 2686 * PropertyValueAliases.txt. 2687 * 2688 * @return a value integer or UCHAR_INVALID_CODE if the given name 2689 * does not match any value of the given property, or if the 2690 * property is invalid. Note: U CHAR_GENERAL_CATEGORY values 2691 * are not values of UCharCategory, but rather mask values 2692 * produced by U_GET_GC_MASK(). This allows grouped 2693 * categories such as [:L:] to be represented. 2694 * 2695 * @see UProperty 2696 * @stable ICU 2.4 2697 */ 2698 U_STABLE int32_t U_EXPORT2 2699 u_getPropertyValueEnum(UProperty property, 2700 const char* alias); 2701 2702 /** 2703 * Determines if the specified character is permissible as the 2704 * first character in an identifier according to Unicode 2705 * (The Unicode Standard, Version 3.0, chapter 5.16 Identifiers). 2706 * True for characters with general categories "L" (letters) and "Nl" (letter numbers). 2707 * 2708 * Same as java.lang.Character.isUnicodeIdentifierStart(). 2709 * Same as UCHAR_ID_START 2710 * 2711 * @param c the code point to be tested 2712 * @return TRUE if the code point may start an identifier 2713 * 2714 * @see UCHAR_ID_START 2715 * @see u_isalpha 2716 * @see u_isIDPart 2717 * @stable ICU 2.0 2718 */ 2719 U_STABLE UBool U_EXPORT2 2720 u_isIDStart(UChar32 c); 2721 2722 /** 2723 * Determines if the specified character is permissible 2724 * in an identifier according to Java. 2725 * True for characters with general categories "L" (letters), 2726 * "Nl" (letter numbers), "Nd" (decimal digits), 2727 * "Mc" and "Mn" (combining marks), "Pc" (connecting punctuation), and 2728 * u_isIDIgnorable(c). 2729 * 2730 * Same as java.lang.Character.isUnicodeIdentifierPart(). 2731 * Almost the same as Unicode's ID_Continue (UCHAR_ID_CONTINUE) 2732 * except that Unicode recommends to ignore Cf which is less than 2733 * u_isIDIgnorable(c). 2734 * 2735 * @param c the code point to be tested 2736 * @return TRUE if the code point may occur in an identifier according to Java 2737 * 2738 * @see UCHAR_ID_CONTINUE 2739 * @see u_isIDStart 2740 * @see u_isIDIgnorable 2741 * @stable ICU 2.0 2742 */ 2743 U_STABLE UBool U_EXPORT2 2744 u_isIDPart(UChar32 c); 2745 2746 /** 2747 * Determines if the specified character should be regarded 2748 * as an ignorable character in an identifier, 2749 * according to Java. 2750 * True for characters with general category "Cf" (format controls) as well as 2751 * non-whitespace ISO controls 2752 * (U+0000..U+0008, U+000E..U+001B, U+007F..U+0084, U+0086..U+009F). 2753 * 2754 * Same as java.lang.Character.isIdentifierIgnorable() 2755 * except that Java also returns TRUE for U+0085 Next Line 2756 * (it omits U+0085 from whitespace ISO controls). 2757 * 2758 * Note that Unicode just recommends to ignore Cf (format controls). 2759 * 2760 * @param c the code point to be tested 2761 * @return TRUE if the code point is ignorable in identifiers according to Java 2762 * 2763 * @see UCHAR_DEFAULT_IGNORABLE_CODE_POINT 2764 * @see u_isIDStart 2765 * @see u_isIDPart 2766 * @stable ICU 2.0 2767 */ 2768 U_STABLE UBool U_EXPORT2 2769 u_isIDIgnorable(UChar32 c); 2770 2771 /** 2772 * Determines if the specified character is permissible as the 2773 * first character in a Java identifier. 2774 * In addition to u_isIDStart(c), true for characters with 2775 * general categories "Sc" (currency symbols) and "Pc" (connecting punctuation). 2776 * 2777 * Same as java.lang.Character.isJavaIdentifierStart(). 2778 * 2779 * @param c the code point to be tested 2780 * @return TRUE if the code point may start a Java identifier 2781 * 2782 * @see u_isJavaIDPart 2783 * @see u_isalpha 2784 * @see u_isIDStart 2785 * @stable ICU 2.0 2786 */ 2787 U_STABLE UBool U_EXPORT2 2788 u_isJavaIDStart(UChar32 c); 2789 2790 /** 2791 * Determines if the specified character is permissible 2792 * in a Java identifier. 2793 * In addition to u_isIDPart(c), true for characters with 2794 * general category "Sc" (currency symbols). 2795 * 2796 * Same as java.lang.Character.isJavaIdentifierPart(). 2797 * 2798 * @param c the code point to be tested 2799 * @return TRUE if the code point may occur in a Java identifier 2800 * 2801 * @see u_isIDIgnorable 2802 * @see u_isJavaIDStart 2803 * @see u_isalpha 2804 * @see u_isdigit 2805 * @see u_isIDPart 2806 * @stable ICU 2.0 2807 */ 2808 U_STABLE UBool U_EXPORT2 2809 u_isJavaIDPart(UChar32 c); 2810 2811 /** 2812 * The given character is mapped to its lowercase equivalent according to 2813 * UnicodeData.txt; if the character has no lowercase equivalent, the character 2814 * itself is returned. 2815 * 2816 * Same as java.lang.Character.toLowerCase(). 2817 * 2818 * This function only returns the simple, single-code point case mapping. 2819 * Full case mappings should be used whenever possible because they produce 2820 * better results by working on whole strings. 2821 * They take into account the string context and the language and can map 2822 * to a result string with a different length as appropriate. 2823 * Full case mappings are applied by the string case mapping functions, 2824 * see ustring.h and the UnicodeString class. 2825 * See also the User Guide chapter on C/POSIX migration: 2826 * http://icu-project.org/userguide/posix.html#case_mappings 2827 * 2828 * @param c the code point to be mapped 2829 * @return the Simple_Lowercase_Mapping of the code point, if any; 2830 * otherwise the code point itself. 2831 * @stable ICU 2.0 2832 */ 2833 U_STABLE UChar32 U_EXPORT2 2834 u_tolower(UChar32 c); 2835 2836 /** 2837 * The given character is mapped to its uppercase equivalent according to UnicodeData.txt; 2838 * if the character has no uppercase equivalent, the character itself is 2839 * returned. 2840 * 2841 * Same as java.lang.Character.toUpperCase(). 2842 * 2843 * This function only returns the simple, single-code point case mapping. 2844 * Full case mappings should be used whenever possible because they produce 2845 * better results by working on whole strings. 2846 * They take into account the string context and the language and can map 2847 * to a result string with a different length as appropriate. 2848 * Full case mappings are applied by the string case mapping functions, 2849 * see ustring.h and the UnicodeString class. 2850 * See also the User Guide chapter on C/POSIX migration: 2851 * http://icu-project.org/userguide/posix.html#case_mappings 2852 * 2853 * @param c the code point to be mapped 2854 * @return the Simple_Uppercase_Mapping of the code point, if any; 2855 * otherwise the code point itself. 2856 * @stable ICU 2.0 2857 */ 2858 U_STABLE UChar32 U_EXPORT2 2859 u_toupper(UChar32 c); 2860 2861 /** 2862 * The given character is mapped to its titlecase equivalent 2863 * according to UnicodeData.txt; 2864 * if none is defined, the character itself is returned. 2865 * 2866 * Same as java.lang.Character.toTitleCase(). 2867 * 2868 * This function only returns the simple, single-code point case mapping. 2869 * Full case mappings should be used whenever possible because they produce 2870 * better results by working on whole strings. 2871 * They take into account the string context and the language and can map 2872 * to a result string with a different length as appropriate. 2873 * Full case mappings are applied by the string case mapping functions, 2874 * see ustring.h and the UnicodeString class. 2875 * See also the User Guide chapter on C/POSIX migration: 2876 * http://icu-project.org/userguide/posix.html#case_mappings 2877 * 2878 * @param c the code point to be mapped 2879 * @return the Simple_Titlecase_Mapping of the code point, if any; 2880 * otherwise the code point itself. 2881 * @stable ICU 2.0 2882 */ 2883 U_STABLE UChar32 U_EXPORT2 2884 u_totitle(UChar32 c); 2885 2886 /** Option value for case folding: use default mappings defined in CaseFolding.txt. @stable ICU 2.0 */ 2887 #define U_FOLD_CASE_DEFAULT 0 2888 2889 /** 2890 * Option value for case folding: 2891 * 2892 * Use the modified set of mappings provided in CaseFolding.txt to handle dotted I 2893 * and dotless i appropriately for Turkic languages (tr, az). 2894 * 2895 * Before Unicode 3.2, CaseFolding.txt contains mappings marked with 'I' that 2896 * are to be included for default mappings and 2897 * excluded for the Turkic-specific mappings. 2898 * 2899 * Unicode 3.2 CaseFolding.txt instead contains mappings marked with 'T' that 2900 * are to be excluded for default mappings and 2901 * included for the Turkic-specific mappings. 2902 * 2903 * @stable ICU 2.0 2904 */ 2905 #define U_FOLD_CASE_EXCLUDE_SPECIAL_I 1 2906 2907 /** 2908 * The given character is mapped to its case folding equivalent according to 2909 * UnicodeData.txt and CaseFolding.txt; 2910 * if the character has no case folding equivalent, the character 2911 * itself is returned. 2912 * 2913 * This function only returns the simple, single-code point case mapping. 2914 * Full case mappings should be used whenever possible because they produce 2915 * better results by working on whole strings. 2916 * They take into account the string context and the language and can map 2917 * to a result string with a different length as appropriate. 2918 * Full case mappings are applied by the string case mapping functions, 2919 * see ustring.h and the UnicodeString class. 2920 * See also the User Guide chapter on C/POSIX migration: 2921 * http://icu-project.org/userguide/posix.html#case_mappings 2922 * 2923 * @param c the code point to be mapped 2924 * @param options Either U_FOLD_CASE_DEFAULT or U_FOLD_CASE_EXCLUDE_SPECIAL_I 2925 * @return the Simple_Case_Folding of the code point, if any; 2926 * otherwise the code point itself. 2927 * @stable ICU 2.0 2928 */ 2929 U_STABLE UChar32 U_EXPORT2 2930 u_foldCase(UChar32 c, uint32_t options); 2931 2932 /** 2933 * Returns the decimal digit value of the code point in the 2934 * specified radix. 2935 * 2936 * If the radix is not in the range <code>2<=radix<=36</code> or if the 2937 * value of <code>c</code> is not a valid digit in the specified 2938 * radix, <code>-1</code> is returned. A character is a valid digit 2939 * if at least one of the following is true: 2940 * <ul> 2941 * <li>The character has a decimal digit value. 2942 * Such characters have the general category "Nd" (decimal digit numbers) 2943 * and a Numeric_Type of Decimal. 2944 * In this case the value is the character's decimal digit value.</li> 2945 * <li>The character is one of the uppercase Latin letters 2946 * <code>'A'</code> through <code>'Z'</code>. 2947 * In this case the value is <code>c-'A'+10</code>.</li> 2948 * <li>The character is one of the lowercase Latin letters 2949 * <code>'a'</code> through <code>'z'</code>. 2950 * In this case the value is <code>ch-'a'+10</code>.</li> 2951 * <li>Latin letters from both the ASCII range (0061..007A, 0041..005A) 2952 * as well as from the Fullwidth ASCII range (FF41..FF5A, FF21..FF3A) 2953 * are recognized.</li> 2954 * </ul> 2955 * 2956 * Same as java.lang.Character.digit(). 2957 * 2958 * @param ch the code point to be tested. 2959 * @param radix the radix. 2960 * @return the numeric value represented by the character in the 2961 * specified radix, 2962 * or -1 if there is no value or if the value exceeds the radix. 2963 * 2964 * @see UCHAR_NUMERIC_TYPE 2965 * @see u_forDigit 2966 * @see u_charDigitValue 2967 * @see u_isdigit 2968 * @stable ICU 2.0 2969 */ 2970 U_STABLE int32_t U_EXPORT2 2971 u_digit(UChar32 ch, int8_t radix); 2972 2973 /** 2974 * Determines the character representation for a specific digit in 2975 * the specified radix. If the value of <code>radix</code> is not a 2976 * valid radix, or the value of <code>digit</code> is not a valid 2977 * digit in the specified radix, the null character 2978 * (<code>U+0000</code>) is returned. 2979 * <p> 2980 * The <code>radix</code> argument is valid if it is greater than or 2981 * equal to 2 and less than or equal to 36. 2982 * The <code>digit</code> argument is valid if 2983 * <code>0 <= digit < radix</code>. 2984 * <p> 2985 * If the digit is less than 10, then 2986 * <code>'0' + digit</code> is returned. Otherwise, the value 2987 * <code>'a' + digit - 10</code> is returned. 2988 * 2989 * Same as java.lang.Character.forDigit(). 2990 * 2991 * @param digit the number to convert to a character. 2992 * @param radix the radix. 2993 * @return the <code>char</code> representation of the specified digit 2994 * in the specified radix. 2995 * 2996 * @see u_digit 2997 * @see u_charDigitValue 2998 * @see u_isdigit 2999 * @stable ICU 2.0 3000 */ 3001 U_STABLE UChar32 U_EXPORT2 3002 u_forDigit(int32_t digit, int8_t radix); 3003 3004 /** 3005 * Get the "age" of the code point. 3006 * The "age" is the Unicode version when the code point was first 3007 * designated (as a non-character or for Private Use) 3008 * or assigned a character. 3009 * This can be useful to avoid emitting code points to receiving 3010 * processes that do not accept newer characters. 3011 * The data is from the UCD file DerivedAge.txt. 3012 * 3013 * @param c The code point. 3014 * @param versionArray The Unicode version number array, to be filled in. 3015 * 3016 * @stable ICU 2.1 3017 */ 3018 U_STABLE void U_EXPORT2 3019 u_charAge(UChar32 c, UVersionInfo versionArray); 3020 3021 /** 3022 * Gets the Unicode version information. 3023 * The version array is filled in with the version information 3024 * for the Unicode standard that is currently used by ICU. 3025 * For example, Unicode version 3.1.1 is represented as an array with 3026 * the values { 3, 1, 1, 0 }. 3027 * 3028 * @param versionArray an output array that will be filled in with 3029 * the Unicode version number 3030 * @stable ICU 2.0 3031 */ 3032 U_STABLE void U_EXPORT2 3033 u_getUnicodeVersion(UVersionInfo versionArray); 3034 3035 /** 3036 * Get the FC_NFKC_Closure property string for a character. 3037 * See Unicode Standard Annex #15 for details, search for "FC_NFKC_Closure" 3038 * or for "FNC": http://www.unicode.org/reports/tr15/ 3039 * 3040 * @param c The character (code point) for which to get the FC_NFKC_Closure string. 3041 * It must be <code>0<=c<=0x10ffff</code>. 3042 * @param dest Destination address for copying the string. 3043 * The string will be zero-terminated if possible. 3044 * If there is no FC_NFKC_Closure string, 3045 * then the buffer will be set to the empty string. 3046 * @param destCapacity <code>==sizeof(dest)</code> 3047 * @param pErrorCode Pointer to a UErrorCode variable. 3048 * @return The length of the string, or 0 if there is no FC_NFKC_Closure string for this character. 3049 * If the destCapacity is less than or equal to the length, then the buffer 3050 * contains the truncated name and the returned length indicates the full 3051 * length of the name. 3052 * The length does not include the zero-termination. 3053 * 3054 * @stable ICU 2.2 3055 */ 3056 U_STABLE int32_t U_EXPORT2 3057 u_getFC_NFKC_Closure(UChar32 c, UChar *dest, int32_t destCapacity, UErrorCode *pErrorCode); 3058 3059 U_CDECL_END 3060 3061 #endif /*_UCHAR*/ 3062 /*eof*/ 3063