Update contrib.
2 **********************************************************************
3 * Copyright (C) 1997-2005, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
9 * Modification History:
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 ******************************************************************************
26 #include "unicode/utypes.h"
30 /*==========================================================================*/
31 /* Unicode version number */
32 /*==========================================================================*/
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.
39 * @see u_getUnicodeVersion
42 #define U_UNICODE_VERSION "4.1"
46 * \brief C API: Unicode Properties
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.
52 * Unicode assigns each code point (not just assigned character) values for
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.
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.sourceforge.net/userguide/properties.html).
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
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.
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.
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).
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)
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.
104 * The C/POSIX character classes are also available in UnicodeSet patterns,
105 * using patterns like [:graph:] or \p{graph}.
108 * Note: There are several ICU whitespace functions.
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
123 /** The lowest Unicode code point value. Code points are non-negative. @stable ICU 2.0 */
124 #define UCHAR_MIN_VALUE 0
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.
134 #define UCHAR_MAX_VALUE 0x10ffff
137 * Get a single-bit bit set (a flag) from a bit number 0..31.
140 #define U_MASK(x) ((uint32_t)1<<(x))
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.
148 * Any comment of the form "/ *[name]* /" (spaces added) is such
151 * The U_JG_* and U_GC_*_MASK constants are matched by their symbolic
152 * name, which must match PropertyValueAliases.txt.
156 * Selection constants for Unicode properties.
157 * These constants are used in functions like u_hasBinaryProperty to select
158 * one of the Unicode properties.
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.
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.
169 * @see u_hasBinaryProperty
170 * @see u_getIntPropertyValue
171 * @see u_getUnicodeVersion
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. */
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
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 */
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,
191 /** Binary property Bidi_Control.
192 Format controls which have specific functions
193 in the Bidi Algorithm. @stable ICU 2.1 */
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 */
200 /** Binary property Dash. Variations of dashes. @stable ICU 2.1 */
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,
206 /** Binary property Deprecated (new in Unicode 3.2).
207 The usage of deprecated characters is strongly discouraged. @stable ICU 2.1 */
209 /** Binary property Diacritic. Characters that linguistically modify
210 the meaning of another character to which they apply. @stable ICU 2.1 */
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 */
216 /** Binary property Full_Composition_Exclusion.
217 CompositionExclusions.txt+Singleton Decompositions+
218 Non-Starter Decompositions. @stable ICU 2.1 */
219 UCHAR_FULL_COMPOSITION_EXCLUSION,
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 */
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,
228 /** Binary property Grapheme_Link (new in Unicode 3.2).
229 For programmatic determination of grapheme cluster boundaries. @stable ICU 2.1 */
231 /** Binary property Hex_Digit.
232 Characters commonly used for hexadecimal numbers. @stable ICU 2.1 */
234 /** Binary property Hyphen. Dashes used to mark connections
235 between pieces of words, plus the Katakana middle dot. @stable ICU 2.1 */
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 */
242 /** Binary property ID_Start.
243 Characters that can start an identifier.
244 Lu+Ll+Lt+Lm+Lo+Nl @stable ICU 2.1 */
246 /** Binary property Ideographic.
247 CJKV ideographs. @stable ICU 2.1 */
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,
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,
257 /** Binary property Join_Control.
258 Format controls for cursive joining and ligation. @stable ICU 2.1 */
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,
264 /** Binary property Lowercase. Same as u_isULowercase, different from u_islower.
265 Ll+Other_Lowercase @stable ICU 2.1 */
267 /** Binary property Math. Sm+Other_Math @stable ICU 2.1 */
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,
273 /** Binary property Quotation_Mark. @stable ICU 2.1 */
274 UCHAR_QUOTATION_MARK,
275 /** Binary property Radical (new in Unicode 3.2).
276 For programmatic determination of
277 Ideographic Description Sequences. @stable ICU 2.1 */
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 */
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,
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,
292 /** Binary property Uppercase. Same as u_isUUppercase, different from u_isupper.
293 Lu+Other_Uppercase @stable ICU 2.1 */
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 */
299 /** Binary property XID_Continue.
300 ID_Continue modified to allow closure under
301 normalization forms NFKC and NFKD. @stable ICU 2.1 */
303 /** Binary property XID_Start. ID_Start modified to allow
304 closure under normalization forms NFKC and NFKD. @stable ICU 2.1 */
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,
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/)
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.
320 UCHAR_VARIATION_SELECTOR,
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
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.
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
340 See also com.ibm.text.UCD.NFSkippable in the ICU4J repository,
341 and icu/source/common/unormimp.h .
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
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
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
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.
381 UCHAR_SEGMENT_STARTER,
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/)
386 UCHAR_PATTERN_SYNTAX,
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/)
391 UCHAR_PATTERN_WHITE_SPACE,
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.
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.
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.
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.
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.
417 /** One more than the last constant for binary Unicode properties. @stable ICU 2.1 */
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 */
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,
431 /** Enumerated property Decomposition_Type.
432 Returns UDecompositionType values. @stable ICU 2.2 */
433 UCHAR_DECOMPOSITION_TYPE,
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,
438 /** Enumerated property General_Category.
439 Same as u_charType, returns UCharCategory values. @stable ICU 2.2 */
440 UCHAR_GENERAL_CATEGORY,
441 /** Enumerated property Joining_Group.
442 Returns UJoiningGroup values. @stable ICU 2.2 */
444 /** Enumerated property Joining_Type.
445 Returns UJoiningType values. @stable ICU 2.2 */
447 /** Enumerated property Line_Break.
448 Returns ULineBreak values. @stable ICU 2.2 */
450 /** Enumerated property Numeric_Type.
451 Returns UNumericType values. @stable ICU 2.2 */
453 /** Enumerated property Script.
454 Same as uscript_getScript, returns UScriptCode values. @stable ICU 2.2 */
456 /** Enumerated property Hangul_Syllable_Type, new in Unicode 4.
457 Returns UHangulSyllableType values. @stable ICU 2.6 */
458 UCHAR_HANGUL_SYLLABLE_TYPE,
459 /** Enumerated property NFD_Quick_Check.
460 Returns UNormalizationCheckResult values. @draft ICU 3.0 */
461 UCHAR_NFD_QUICK_CHECK,
462 /** Enumerated property NFKD_Quick_Check.
463 Returns UNormalizationCheckResult values. @draft ICU 3.0 */
464 UCHAR_NFKD_QUICK_CHECK,
465 /** Enumerated property NFC_Quick_Check.
466 Returns UNormalizationCheckResult values. @draft ICU 3.0 */
467 UCHAR_NFC_QUICK_CHECK,
468 /** Enumerated property NFKC_Quick_Check.
469 Returns UNormalizationCheckResult values. @draft ICU 3.0 */
470 UCHAR_NFKC_QUICK_CHECK,
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. @draft ICU 3.0 */
477 UCHAR_LEAD_CANONICAL_COMBINING_CLASS,
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. @draft ICU 3.0 */
484 UCHAR_TRAIL_CANONICAL_COMBINING_CLASS,
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. @draft ICU 3.4 */
489 UCHAR_GRAPHEME_CLUSTER_BREAK,
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. @draft ICU 3.4 */
494 UCHAR_SENTENCE_BREAK,
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. @draft ICU 3.4 */
500 /** One more than the last constant for enumerated/integer Unicode properties. @stable ICU 2.2 */
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.
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 */
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 */
525 /** String property Age.
526 Corresponds to u_charAge. @stable ICU 2.4 */
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,
533 /** String property Case_Folding.
534 Corresponds to u_strFoldCase in ustring.h. @stable ICU 2.4 */
536 /** String property ISO_Comment.
537 Corresponds to u_getISOComment. @stable ICU 2.4 */
539 /** String property Lowercase_Mapping.
540 Corresponds to u_strToLower in ustring.h. @stable ICU 2.4 */
541 UCHAR_LOWERCASE_MAPPING,
542 /** String property Name.
543 Corresponds to u_charName. @stable ICU 2.4 */
545 /** String property Simple_Case_Folding.
546 Corresponds to u_foldCase. @stable ICU 2.4 */
547 UCHAR_SIMPLE_CASE_FOLDING,
548 /** String property Simple_Lowercase_Mapping.
549 Corresponds to u_tolower. @stable ICU 2.4 */
550 UCHAR_SIMPLE_LOWERCASE_MAPPING,
551 /** String property Simple_Titlecase_Mapping.
552 Corresponds to u_totitle. @stable ICU 2.4 */
553 UCHAR_SIMPLE_TITLECASE_MAPPING,
554 /** String property Simple_Uppercase_Mapping.
555 Corresponds to u_toupper. @stable ICU 2.4 */
556 UCHAR_SIMPLE_UPPERCASE_MAPPING,
557 /** String property Titlecase_Mapping.
558 Corresponds to u_strToTitle in ustring.h. @stable ICU 2.4 */
559 UCHAR_TITLECASE_MAPPING,
560 /** String property Unicode_1_Name.
561 Corresponds to u_charName. @stable ICU 2.4 */
562 UCHAR_UNICODE_1_NAME,
563 /** String property Uppercase_Mapping.
564 Corresponds to u_strToUpper in ustring.h. @stable ICU 2.4 */
565 UCHAR_UPPERCASE_MAPPING,
566 /** One more than the last constant for string Unicode properties. @stable ICU 2.4 */
569 /** Represents a nonexistent or invalid property or property value. @stable ICU 2.4 */
570 UCHAR_INVALID_CODE = -1
574 * Data for enumerated Unicode general category types.
575 * See http://www.unicode.org/Public/UNIDATA/UnicodeData.html .
578 typedef enum UCharCategory
580 /** See note !!. Comments of the form "Cn" are read by genpname. */
582 /** Non-category for unassigned and non-character code points. @stable ICU 2.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 */
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 */
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 */
616 /** Cf @stable ICU 2.0 */
618 /** Co @stable ICU 2.0 */
619 U_PRIVATE_USE_CHAR = 17,
620 /** Cs @stable ICU 2.0 */
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 */
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 */
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
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.
654 * There are also some U_GC_Y_MASK constants for groups of general categories
655 * like L for all letter categories.
662 #define U_GC_CN_MASK U_MASK(U_GENERAL_OTHER_TYPES)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
761 * This specifies the language directional property of a character set.
764 typedef enum UCharDirection {
765 /** See note !!. Comments of the form "EN" are read by genpname. */
767 /** L @stable ICU 2.0 */
769 /** R @stable ICU 2.0 */
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 */
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
810 * Constants for Unicode blocks, see the Unicode Data file Blocks.txt
815 /** New No_Block value in Unicode 4. @stable ICU 2.6 */
816 UBLOCK_NO_BLOCK = 0, /*[none]*/ /* Special range indicating No_Block */
818 /** @stable ICU 2.0 */
819 UBLOCK_BASIC_LATIN = 1, /*[0000]*/ /*See note !!*/
821 /** @stable ICU 2.0 */
822 UBLOCK_LATIN_1_SUPPLEMENT=2, /*[0080]*/
824 /** @stable ICU 2.0 */
825 UBLOCK_LATIN_EXTENDED_A =3, /*[0100]*/
827 /** @stable ICU 2.0 */
828 UBLOCK_LATIN_EXTENDED_B =4, /*[0180]*/
830 /** @stable ICU 2.0 */
831 UBLOCK_IPA_EXTENSIONS =5, /*[0250]*/
833 /** @stable ICU 2.0 */
834 UBLOCK_SPACING_MODIFIER_LETTERS =6, /*[02B0]*/
836 /** @stable ICU 2.0 */
837 UBLOCK_COMBINING_DIACRITICAL_MARKS =7, /*[0300]*/
840 * Unicode 3.2 renames this block to "Greek and Coptic".
843 UBLOCK_GREEK =8, /*[0370]*/
845 /** @stable ICU 2.0 */
846 UBLOCK_CYRILLIC =9, /*[0400]*/
848 /** @stable ICU 2.0 */
849 UBLOCK_ARMENIAN =10, /*[0530]*/
851 /** @stable ICU 2.0 */
852 UBLOCK_HEBREW =11, /*[0590]*/
854 /** @stable ICU 2.0 */
855 UBLOCK_ARABIC =12, /*[0600]*/
857 /** @stable ICU 2.0 */
858 UBLOCK_SYRIAC =13, /*[0700]*/
860 /** @stable ICU 2.0 */
861 UBLOCK_THAANA =14, /*[0780]*/
863 /** @stable ICU 2.0 */
864 UBLOCK_DEVANAGARI =15, /*[0900]*/
866 /** @stable ICU 2.0 */
867 UBLOCK_BENGALI =16, /*[0980]*/
869 /** @stable ICU 2.0 */
870 UBLOCK_GURMUKHI =17, /*[0A00]*/
872 /** @stable ICU 2.0 */
873 UBLOCK_GUJARATI =18, /*[0A80]*/
875 /** @stable ICU 2.0 */
876 UBLOCK_ORIYA =19, /*[0B00]*/
878 /** @stable ICU 2.0 */
879 UBLOCK_TAMIL =20, /*[0B80]*/
881 /** @stable ICU 2.0 */
882 UBLOCK_TELUGU =21, /*[0C00]*/
884 /** @stable ICU 2.0 */
885 UBLOCK_KANNADA =22, /*[0C80]*/
887 /** @stable ICU 2.0 */
888 UBLOCK_MALAYALAM =23, /*[0D00]*/
890 /** @stable ICU 2.0 */
891 UBLOCK_SINHALA =24, /*[0D80]*/
893 /** @stable ICU 2.0 */
894 UBLOCK_THAI =25, /*[0E00]*/
896 /** @stable ICU 2.0 */
897 UBLOCK_LAO =26, /*[0E80]*/
899 /** @stable ICU 2.0 */
900 UBLOCK_TIBETAN =27, /*[0F00]*/
902 /** @stable ICU 2.0 */
903 UBLOCK_MYANMAR =28, /*[1000]*/
905 /** @stable ICU 2.0 */
906 UBLOCK_GEORGIAN =29, /*[10A0]*/
908 /** @stable ICU 2.0 */
909 UBLOCK_HANGUL_JAMO =30, /*[1100]*/
911 /** @stable ICU 2.0 */
912 UBLOCK_ETHIOPIC =31, /*[1200]*/
914 /** @stable ICU 2.0 */
915 UBLOCK_CHEROKEE =32, /*[13A0]*/
917 /** @stable ICU 2.0 */
918 UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS =33, /*[1400]*/
920 /** @stable ICU 2.0 */
921 UBLOCK_OGHAM =34, /*[1680]*/
923 /** @stable ICU 2.0 */
924 UBLOCK_RUNIC =35, /*[16A0]*/
926 /** @stable ICU 2.0 */
927 UBLOCK_KHMER =36, /*[1780]*/
929 /** @stable ICU 2.0 */
930 UBLOCK_MONGOLIAN =37, /*[1800]*/
932 /** @stable ICU 2.0 */
933 UBLOCK_LATIN_EXTENDED_ADDITIONAL =38, /*[1E00]*/
935 /** @stable ICU 2.0 */
936 UBLOCK_GREEK_EXTENDED =39, /*[1F00]*/
938 /** @stable ICU 2.0 */
939 UBLOCK_GENERAL_PUNCTUATION =40, /*[2000]*/
941 /** @stable ICU 2.0 */
942 UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS =41, /*[2070]*/
944 /** @stable ICU 2.0 */
945 UBLOCK_CURRENCY_SYMBOLS =42, /*[20A0]*/
948 * Unicode 3.2 renames this block to "Combining Diacritical Marks for Symbols".
951 UBLOCK_COMBINING_MARKS_FOR_SYMBOLS =43, /*[20D0]*/
953 /** @stable ICU 2.0 */
954 UBLOCK_LETTERLIKE_SYMBOLS =44, /*[2100]*/
956 /** @stable ICU 2.0 */
957 UBLOCK_NUMBER_FORMS =45, /*[2150]*/
959 /** @stable ICU 2.0 */
960 UBLOCK_ARROWS =46, /*[2190]*/
962 /** @stable ICU 2.0 */
963 UBLOCK_MATHEMATICAL_OPERATORS =47, /*[2200]*/
965 /** @stable ICU 2.0 */
966 UBLOCK_MISCELLANEOUS_TECHNICAL =48, /*[2300]*/
968 /** @stable ICU 2.0 */
969 UBLOCK_CONTROL_PICTURES =49, /*[2400]*/
971 /** @stable ICU 2.0 */
972 UBLOCK_OPTICAL_CHARACTER_RECOGNITION =50, /*[2440]*/
974 /** @stable ICU 2.0 */
975 UBLOCK_ENCLOSED_ALPHANUMERICS =51, /*[2460]*/
977 /** @stable ICU 2.0 */
978 UBLOCK_BOX_DRAWING =52, /*[2500]*/
980 /** @stable ICU 2.0 */
981 UBLOCK_BLOCK_ELEMENTS =53, /*[2580]*/
983 /** @stable ICU 2.0 */
984 UBLOCK_GEOMETRIC_SHAPES =54, /*[25A0]*/
986 /** @stable ICU 2.0 */
987 UBLOCK_MISCELLANEOUS_SYMBOLS =55, /*[2600]*/
989 /** @stable ICU 2.0 */
990 UBLOCK_DINGBATS =56, /*[2700]*/
992 /** @stable ICU 2.0 */
993 UBLOCK_BRAILLE_PATTERNS =57, /*[2800]*/
995 /** @stable ICU 2.0 */
996 UBLOCK_CJK_RADICALS_SUPPLEMENT =58, /*[2E80]*/
998 /** @stable ICU 2.0 */
999 UBLOCK_KANGXI_RADICALS =59, /*[2F00]*/
1001 /** @stable ICU 2.0 */
1002 UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS =60, /*[2FF0]*/
1004 /** @stable ICU 2.0 */
1005 UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION =61, /*[3000]*/
1007 /** @stable ICU 2.0 */
1008 UBLOCK_HIRAGANA =62, /*[3040]*/
1010 /** @stable ICU 2.0 */
1011 UBLOCK_KATAKANA =63, /*[30A0]*/
1013 /** @stable ICU 2.0 */
1014 UBLOCK_BOPOMOFO =64, /*[3100]*/
1016 /** @stable ICU 2.0 */
1017 UBLOCK_HANGUL_COMPATIBILITY_JAMO =65, /*[3130]*/
1019 /** @stable ICU 2.0 */
1020 UBLOCK_KANBUN =66, /*[3190]*/
1022 /** @stable ICU 2.0 */
1023 UBLOCK_BOPOMOFO_EXTENDED =67, /*[31A0]*/
1025 /** @stable ICU 2.0 */
1026 UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS =68, /*[3200]*/
1028 /** @stable ICU 2.0 */
1029 UBLOCK_CJK_COMPATIBILITY =69, /*[3300]*/
1031 /** @stable ICU 2.0 */
1032 UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A =70, /*[3400]*/
1034 /** @stable ICU 2.0 */
1035 UBLOCK_CJK_UNIFIED_IDEOGRAPHS =71, /*[4E00]*/
1037 /** @stable ICU 2.0 */
1038 UBLOCK_YI_SYLLABLES =72, /*[A000]*/
1040 /** @stable ICU 2.0 */
1041 UBLOCK_YI_RADICALS =73, /*[A490]*/
1043 /** @stable ICU 2.0 */
1044 UBLOCK_HANGUL_SYLLABLES =74, /*[AC00]*/
1046 /** @stable ICU 2.0 */
1047 UBLOCK_HIGH_SURROGATES =75, /*[D800]*/
1049 /** @stable ICU 2.0 */
1050 UBLOCK_HIGH_PRIVATE_USE_SURROGATES =76, /*[DB80]*/
1052 /** @stable ICU 2.0 */
1053 UBLOCK_LOW_SURROGATES =77, /*[DC00]*/
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.
1064 UBLOCK_PRIVATE_USE = 78,
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.
1074 UBLOCK_PRIVATE_USE_AREA =UBLOCK_PRIVATE_USE, /*[E000]*/
1076 /** @stable ICU 2.0 */
1077 UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS =79, /*[F900]*/
1079 /** @stable ICU 2.0 */
1080 UBLOCK_ALPHABETIC_PRESENTATION_FORMS =80, /*[FB00]*/
1082 /** @stable ICU 2.0 */
1083 UBLOCK_ARABIC_PRESENTATION_FORMS_A =81, /*[FB50]*/
1085 /** @stable ICU 2.0 */
1086 UBLOCK_COMBINING_HALF_MARKS =82, /*[FE20]*/
1088 /** @stable ICU 2.0 */
1089 UBLOCK_CJK_COMPATIBILITY_FORMS =83, /*[FE30]*/
1091 /** @stable ICU 2.0 */
1092 UBLOCK_SMALL_FORM_VARIANTS =84, /*[FE50]*/
1094 /** @stable ICU 2.0 */
1095 UBLOCK_ARABIC_PRESENTATION_FORMS_B =85, /*[FE70]*/
1097 /** @stable ICU 2.0 */
1098 UBLOCK_SPECIALS =86, /*[FFF0]*/
1100 /** @stable ICU 2.0 */
1101 UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS =87, /*[FF00]*/
1103 /* New blocks in Unicode 3.1 */
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]*/
1124 /* New blocks in Unicode 3.2 */
1127 * Unicode 4.0.1 renames the "Cyrillic Supplementary" block to "Cyrillic Supplement".
1130 UBLOCK_CYRILLIC_SUPPLEMENTARY = 97,
1131 /** @draft 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]*/
1160 /* New blocks in Unicode 4 */
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]*/
1193 /* New blocks in Unicode 4.1 */
1195 /** @draft ICU 3.4 */
1196 UBLOCK_ANCIENT_GREEK_MUSICAL_NOTATION = 126, /*[1D200]*/
1197 /** @draft ICU 3.4 */
1198 UBLOCK_ANCIENT_GREEK_NUMBERS = 127, /*[10140]*/
1199 /** @draft ICU 3.4 */
1200 UBLOCK_ARABIC_SUPPLEMENT = 128, /*[0750]*/
1201 /** @draft ICU 3.4 */
1202 UBLOCK_BUGINESE = 129, /*[1A00]*/
1203 /** @draft ICU 3.4 */
1204 UBLOCK_CJK_STROKES = 130, /*[31C0]*/
1205 /** @draft ICU 3.4 */
1206 UBLOCK_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT = 131, /*[1DC0]*/
1207 /** @draft ICU 3.4 */
1208 UBLOCK_COPTIC = 132, /*[2C80]*/
1209 /** @draft ICU 3.4 */
1210 UBLOCK_ETHIOPIC_EXTENDED = 133, /*[2D80]*/
1211 /** @draft ICU 3.4 */
1212 UBLOCK_ETHIOPIC_SUPPLEMENT = 134, /*[1380]*/
1213 /** @draft ICU 3.4 */
1214 UBLOCK_GEORGIAN_SUPPLEMENT = 135, /*[2D00]*/
1215 /** @draft ICU 3.4 */
1216 UBLOCK_GLAGOLITIC = 136, /*[2C00]*/
1217 /** @draft ICU 3.4 */
1218 UBLOCK_KHAROSHTHI = 137, /*[10A00]*/
1219 /** @draft ICU 3.4 */
1220 UBLOCK_MODIFIER_TONE_LETTERS = 138, /*[A700]*/
1221 /** @draft ICU 3.4 */
1222 UBLOCK_NEW_TAI_LUE = 139, /*[1980]*/
1223 /** @draft ICU 3.4 */
1224 UBLOCK_OLD_PERSIAN = 140, /*[103A0]*/
1225 /** @draft ICU 3.4 */
1226 UBLOCK_PHONETIC_EXTENSIONS_SUPPLEMENT = 141, /*[1D80]*/
1227 /** @draft ICU 3.4 */
1228 UBLOCK_SUPPLEMENTAL_PUNCTUATION = 142, /*[2E00]*/
1229 /** @draft ICU 3.4 */
1230 UBLOCK_SYLOTI_NAGRI = 143, /*[A800]*/
1231 /** @draft ICU 3.4 */
1232 UBLOCK_TIFINAGH = 144, /*[2D30]*/
1233 /** @draft ICU 3.4 */
1234 UBLOCK_VERTICAL_FORMS = 145, /*[FE10]*/
1236 /** @stable ICU 2.0 */
1239 /** @stable ICU 2.0 */
1240 UBLOCK_INVALID_CODE=-1
1243 /** @stable ICU 2.0 */
1244 typedef enum UBlockCode UBlockCode;
1247 * East Asian Width constants.
1249 * @see UCHAR_EAST_ASIAN_WIDTH
1250 * @see u_getIntPropertyValue
1253 typedef enum UEastAsianWidth {
1254 U_EA_NEUTRAL, /*[N]*/ /*See note !!*/
1255 U_EA_AMBIGUOUS, /*[A]*/
1256 U_EA_HALFWIDTH, /*[H]*/
1257 U_EA_FULLWIDTH, /*[F]*/
1258 U_EA_NARROW, /*[Na]*/
1263 * Implementation note:
1264 * Keep UEastAsianWidth constant values in sync with names list in genprops/props2.c.
1268 * Selector constants for u_charName().
1269 * u_charName() returns the "modern" name of a
1270 * Unicode character; or the name that was defined in
1271 * Unicode version 1.0, before the Unicode standard merged
1272 * with ISO-10646; or an "extended" name that gives each
1273 * Unicode code point a unique name.
1278 typedef enum UCharNameChoice {
1279 U_UNICODE_CHAR_NAME,
1280 U_UNICODE_10_CHAR_NAME,
1281 U_EXTENDED_CHAR_NAME,
1282 U_CHAR_NAME_CHOICE_COUNT
1286 * Selector constants for u_getPropertyName() and
1287 * u_getPropertyValueName(). These selectors are used to choose which
1288 * name is returned for a given property or value. All properties and
1289 * values have a long name. Most have a short name, but some do not.
1290 * Unicode allows for additional names, beyond the long and short
1291 * name, which would be indicated by U_LONG_PROPERTY_NAME + i, where
1294 * @see u_getPropertyName()
1295 * @see u_getPropertyValueName()
1298 typedef enum UPropertyNameChoice {
1299 U_SHORT_PROPERTY_NAME,
1300 U_LONG_PROPERTY_NAME,
1301 U_PROPERTY_NAME_CHOICE_COUNT
1302 } UPropertyNameChoice;
1305 * Decomposition Type constants.
1307 * @see UCHAR_DECOMPOSITION_TYPE
1310 typedef enum UDecompositionType {
1311 U_DT_NONE, /*[none]*/ /*See note !!*/
1312 U_DT_CANONICAL, /*[can]*/
1313 U_DT_COMPAT, /*[com]*/
1314 U_DT_CIRCLE, /*[enc]*/
1315 U_DT_FINAL, /*[fin]*/
1316 U_DT_FONT, /*[font]*/
1317 U_DT_FRACTION, /*[fra]*/
1318 U_DT_INITIAL, /*[init]*/
1319 U_DT_ISOLATED, /*[iso]*/
1320 U_DT_MEDIAL, /*[med]*/
1321 U_DT_NARROW, /*[nar]*/
1322 U_DT_NOBREAK, /*[nb]*/
1323 U_DT_SMALL, /*[sml]*/
1324 U_DT_SQUARE, /*[sqr]*/
1326 U_DT_SUPER, /*[sup]*/
1327 U_DT_VERTICAL, /*[vert]*/
1328 U_DT_WIDE, /*[wide]*/
1330 } UDecompositionType;
1333 * Joining Type constants.
1335 * @see UCHAR_JOINING_TYPE
1338 typedef enum UJoiningType {
1339 U_JT_NON_JOINING, /*[U]*/ /*See note !!*/
1340 U_JT_JOIN_CAUSING, /*[C]*/
1341 U_JT_DUAL_JOINING, /*[D]*/
1342 U_JT_LEFT_JOINING, /*[L]*/
1343 U_JT_RIGHT_JOINING, /*[R]*/
1344 U_JT_TRANSPARENT, /*[T]*/
1349 * Joining Group constants.
1351 * @see UCHAR_JOINING_GROUP
1354 typedef enum UJoiningGroup {
1355 U_JG_NO_JOINING_GROUP,
1369 U_JG_HAMZA_ON_HEH_GOAL,
1406 U_JG_FE, /**< @stable ICU 2.6 */
1407 U_JG_KHAPH, /**< @stable ICU 2.6 */
1408 U_JG_ZHAIN, /**< @stable ICU 2.6 */
1413 * Grapheme Cluster Break constants.
1415 * @see UCHAR_GRAPHEME_CLUSTER_BREAK
1418 typedef enum UGraphemeClusterBreak {
1419 U_GCB_OTHER, /*[XX]*/ /*See note !!*/
1420 U_GCB_CONTROL, /*[CN]*/
1422 U_GCB_EXTEND, /*[EX]*/
1426 U_GCB_LVT, /*[LVT]*/
1430 } UGraphemeClusterBreak;
1433 * Word Break constants.
1434 * (UWordBreak is a pre-existing enum type in ubrk.h for word break status tags.)
1436 * @see UCHAR_WORD_BREAK
1439 typedef enum UWordBreakValues {
1440 U_WB_OTHER, /*[XX]*/ /*See note !!*/
1441 U_WB_ALETTER, /*[LE]*/
1442 U_WB_FORMAT, /*[FO]*/
1443 U_WB_KATAKANA, /*[KA]*/
1444 U_WB_MIDLETTER, /*[ML]*/
1445 U_WB_MIDNUM, /*[MN]*/
1446 U_WB_NUMERIC, /*[NU]*/
1447 U_WB_EXTENDNUMLET, /*[EX]*/
1452 * Sentence Break constants.
1454 * @see UCHAR_SENTENCE_BREAK
1457 typedef enum USentenceBreak {
1458 U_SB_OTHER, /*[XX]*/ /*See note !!*/
1459 U_SB_ATERM, /*[AT]*/
1460 U_SB_CLOSE, /*[CL]*/
1461 U_SB_FORMAT, /*[FO]*/
1462 U_SB_LOWER, /*[LO]*/
1463 U_SB_NUMERIC, /*[NU]*/
1464 U_SB_OLETTER, /*[LE]*/
1467 U_SB_STERM, /*[ST]*/
1468 U_SB_UPPER, /*[UP]*/
1473 * Line Break constants.
1475 * @see UCHAR_LINE_BREAK
1478 typedef enum ULineBreak {
1479 U_LB_UNKNOWN, /*[XX]*/ /*See note !!*/
1480 U_LB_AMBIGUOUS, /*[AI]*/
1481 U_LB_ALPHABETIC, /*[AL]*/
1482 U_LB_BREAK_BOTH, /*[B2]*/
1483 U_LB_BREAK_AFTER, /*[BA]*/
1484 U_LB_BREAK_BEFORE, /*[BB]*/
1485 U_LB_MANDATORY_BREAK, /*[BK]*/
1486 U_LB_CONTINGENT_BREAK, /*[CB]*/
1487 U_LB_CLOSE_PUNCTUATION, /*[CL]*/
1488 U_LB_COMBINING_MARK, /*[CM]*/
1489 U_LB_CARRIAGE_RETURN, /*[CR]*/
1490 U_LB_EXCLAMATION, /*[EX]*/
1492 U_LB_HYPHEN, /*[HY]*/
1493 U_LB_IDEOGRAPHIC, /*[ID]*/
1495 /** Renamed from the misspelled "inseperable" in Unicode 4.0.1/ICU 3.0 @draft ICU 3.0 */
1496 U_LB_INSEPARABLE=U_LB_INSEPERABLE,/*[IN]*/
1497 U_LB_INFIX_NUMERIC, /*[IS]*/
1498 U_LB_LINE_FEED, /*[LF]*/
1499 U_LB_NONSTARTER, /*[NS]*/
1500 U_LB_NUMERIC, /*[NU]*/
1501 U_LB_OPEN_PUNCTUATION, /*[OP]*/
1502 U_LB_POSTFIX_NUMERIC, /*[PO]*/
1503 U_LB_PREFIX_NUMERIC, /*[PR]*/
1504 U_LB_QUOTATION, /*[QU]*/
1505 U_LB_COMPLEX_CONTEXT, /*[SA]*/
1506 U_LB_SURROGATE, /*[SG]*/
1507 U_LB_SPACE, /*[SP]*/
1508 U_LB_BREAK_SYMBOLS, /*[SY]*/
1509 U_LB_ZWSPACE, /*[ZW]*/
1510 U_LB_NEXT_LINE, /*[NL]*/ /* from here on: new in Unicode 4/ICU 2.6 */
1511 U_LB_WORD_JOINER, /*[WJ]*/
1512 U_LB_H2, /*[H2]*/ /* from here on: new in Unicode 4.1/ICU 3.4 */
1521 * Numeric Type constants.
1523 * @see UCHAR_NUMERIC_TYPE
1526 typedef enum UNumericType {
1527 U_NT_NONE, /*[None]*/ /*See note !!*/
1528 U_NT_DECIMAL, /*[de]*/
1529 U_NT_DIGIT, /*[di]*/
1530 U_NT_NUMERIC, /*[nu]*/
1535 * Hangul Syllable Type constants.
1537 * @see UCHAR_HANGUL_SYLLABLE_TYPE
1540 typedef enum UHangulSyllableType {
1541 U_HST_NOT_APPLICABLE, /*[NA]*/ /*See note !!*/
1542 U_HST_LEADING_JAMO, /*[L]*/
1543 U_HST_VOWEL_JAMO, /*[V]*/
1544 U_HST_TRAILING_JAMO, /*[T]*/
1545 U_HST_LV_SYLLABLE, /*[LV]*/
1546 U_HST_LVT_SYLLABLE, /*[LVT]*/
1548 } UHangulSyllableType;
1551 * Check a binary Unicode property for a code point.
1553 * Unicode, especially in version 3.2, defines many more properties than the
1554 * original set in UnicodeData.txt.
1556 * The properties APIs are intended to reflect Unicode properties as defined
1557 * in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR).
1558 * For details about the properties see http://www.unicode.org/ucd/ .
1559 * For names of Unicode properties see the UCD file PropertyAliases.txt.
1561 * Important: If ICU is built with UCD files from Unicode versions below 3.2,
1562 * then properties marked with "new in Unicode 3.2" are not or not fully available.
1564 * @param c Code point to test.
1565 * @param which UProperty selector constant, identifies which binary property to check.
1566 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT.
1567 * @return TRUE or FALSE according to the binary Unicode property value for c.
1568 * Also FALSE if 'which' is out of bounds or if the Unicode version
1569 * does not have data for the property at all, or not for this code point.
1572 * @see u_getIntPropertyValue
1573 * @see u_getUnicodeVersion
1576 U_STABLE UBool U_EXPORT2
1577 u_hasBinaryProperty(UChar32 c, UProperty which);
1580 * Check if a code point has the Alphabetic Unicode property.
1581 * Same as u_hasBinaryProperty(c, UCHAR_ALPHABETIC).
1582 * This is different from u_isalpha!
1583 * @param c Code point to test
1584 * @return true if the code point has the Alphabetic Unicode property, false otherwise
1586 * @see UCHAR_ALPHABETIC
1588 * @see u_hasBinaryProperty
1591 U_STABLE UBool U_EXPORT2
1592 u_isUAlphabetic(UChar32 c);
1595 * Check if a code point has the Lowercase Unicode property.
1596 * Same as u_hasBinaryProperty(c, UCHAR_LOWERCASE).
1597 * This is different from u_islower!
1598 * @param c Code point to test
1599 * @return true if the code point has the Lowercase Unicode property, false otherwise
1601 * @see UCHAR_LOWERCASE
1603 * @see u_hasBinaryProperty
1606 U_STABLE UBool U_EXPORT2
1607 u_isULowercase(UChar32 c);
1610 * Check if a code point has the Uppercase Unicode property.
1611 * Same as u_hasBinaryProperty(c, UCHAR_UPPERCASE).
1612 * This is different from u_isupper!
1613 * @param c Code point to test
1614 * @return true if the code point has the Uppercase Unicode property, false otherwise
1616 * @see UCHAR_UPPERCASE
1618 * @see u_hasBinaryProperty
1621 U_STABLE UBool U_EXPORT2
1622 u_isUUppercase(UChar32 c);
1625 * Check if a code point has the White_Space Unicode property.
1626 * Same as u_hasBinaryProperty(c, UCHAR_WHITE_SPACE).
1627 * This is different from both u_isspace and u_isWhitespace!
1629 * Note: There are several ICU whitespace functions; please see the uchar.h
1630 * file documentation for a detailed comparison.
1632 * @param c Code point to test
1633 * @return true if the code point has the White_Space Unicode property, false otherwise.
1635 * @see UCHAR_WHITE_SPACE
1636 * @see u_isWhitespace
1638 * @see u_isJavaSpaceChar
1639 * @see u_hasBinaryProperty
1642 U_STABLE UBool U_EXPORT2
1643 u_isUWhiteSpace(UChar32 c);
1646 * Get the property value for an enumerated or integer Unicode property for a code point.
1647 * Also returns binary and mask property values.
1649 * Unicode, especially in version 3.2, defines many more properties than the
1650 * original set in UnicodeData.txt.
1652 * The properties APIs are intended to reflect Unicode properties as defined
1653 * in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR).
1654 * For details about the properties see http://www.unicode.org/ .
1655 * For names of Unicode properties see the UCD file PropertyAliases.txt.
1658 * UEastAsianWidth ea=(UEastAsianWidth)u_getIntPropertyValue(c, UCHAR_EAST_ASIAN_WIDTH);
1659 * UBool b=(UBool)u_getIntPropertyValue(c, UCHAR_IDEOGRAPHIC);
1661 * @param c Code point to test.
1662 * @param which UProperty selector constant, identifies which property to check.
1663 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT
1664 * or UCHAR_INT_START<=which<UCHAR_INT_LIMIT
1665 * or UCHAR_MASK_START<=which<UCHAR_MASK_LIMIT.
1666 * @return Numeric value that is directly the property value or,
1667 * for enumerated properties, corresponds to the numeric value of the enumerated
1668 * constant of the respective property value enumeration type
1669 * (cast to enum type if necessary).
1670 * Returns 0 or 1 (for FALSE/TRUE) for binary Unicode properties.
1671 * Returns a bit-mask for mask properties.
1672 * Returns 0 if 'which' is out of bounds or if the Unicode version
1673 * does not have data for the property at all, or not for this code point.
1676 * @see u_hasBinaryProperty
1677 * @see u_getIntPropertyMinValue
1678 * @see u_getIntPropertyMaxValue
1679 * @see u_getUnicodeVersion
1682 U_STABLE int32_t U_EXPORT2
1683 u_getIntPropertyValue(UChar32 c, UProperty which);
1686 * Get the minimum value for an enumerated/integer/binary Unicode property.
1687 * Can be used together with u_getIntPropertyMaxValue
1688 * to allocate arrays of UnicodeSet or similar.
1690 * @param which UProperty selector constant, identifies which binary property to check.
1691 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT
1692 * or UCHAR_INT_START<=which<UCHAR_INT_LIMIT.
1693 * @return Minimum value returned by u_getIntPropertyValue for a Unicode property.
1694 * 0 if the property selector is out of range.
1697 * @see u_hasBinaryProperty
1698 * @see u_getUnicodeVersion
1699 * @see u_getIntPropertyMaxValue
1700 * @see u_getIntPropertyValue
1703 U_STABLE int32_t U_EXPORT2
1704 u_getIntPropertyMinValue(UProperty which);
1707 * Get the maximum value for an enumerated/integer/binary Unicode property.
1708 * Can be used together with u_getIntPropertyMinValue
1709 * to allocate arrays of UnicodeSet or similar.
1711 * Examples for min/max values (for Unicode 3.2):
1713 * - UCHAR_BIDI_CLASS: 0/18 (U_LEFT_TO_RIGHT/U_BOUNDARY_NEUTRAL)
1714 * - UCHAR_SCRIPT: 0/45 (USCRIPT_COMMON/USCRIPT_TAGBANWA)
1715 * - UCHAR_IDEOGRAPHIC: 0/1 (FALSE/TRUE)
1717 * For undefined UProperty constant values, min/max values will be 0/-1.
1719 * @param which UProperty selector constant, identifies which binary property to check.
1720 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT
1721 * or UCHAR_INT_START<=which<UCHAR_INT_LIMIT.
1722 * @return Maximum value returned by u_getIntPropertyValue for a Unicode property.
1723 * <=0 if the property selector is out of range.
1726 * @see u_hasBinaryProperty
1727 * @see u_getUnicodeVersion
1728 * @see u_getIntPropertyMaxValue
1729 * @see u_getIntPropertyValue
1732 U_STABLE int32_t U_EXPORT2
1733 u_getIntPropertyMaxValue(UProperty which);
1736 * Get the numeric value for a Unicode code point as defined in the
1737 * Unicode Character Database.
1739 * A "double" return type is necessary because
1740 * some numeric values are fractions, negative, or too large for int32_t.
1742 * For characters without any numeric values in the Unicode Character Database,
1743 * this function will return U_NO_NUMERIC_VALUE.
1745 * Similar to java.lang.Character.getNumericValue(), but u_getNumericValue()
1746 * also supports negative values, large values, and fractions,
1747 * while Java's getNumericValue() returns values 10..35 for ASCII letters.
1749 * @param c Code point to get the numeric value for.
1750 * @return Numeric value of c, or U_NO_NUMERIC_VALUE if none is defined.
1752 * @see U_NO_NUMERIC_VALUE
1755 U_STABLE double U_EXPORT2
1756 u_getNumericValue(UChar32 c);
1759 * Special value that is returned by u_getNumericValue when
1760 * no numeric value is defined for a code point.
1762 * @see u_getNumericValue
1765 #define U_NO_NUMERIC_VALUE ((double)-123456789.)
1768 * Determines whether the specified code point has the general category "Ll"
1769 * (lowercase letter).
1771 * Same as java.lang.Character.isLowerCase().
1773 * This misses some characters that are also lowercase but
1774 * have a different general category value.
1775 * In order to include those, use UCHAR_LOWERCASE.
1777 * In addition to being equivalent to a Java function, this also serves
1778 * as a C/POSIX migration function.
1779 * See the comments about C/POSIX character classification functions in the
1780 * documentation at the top of this header file.
1782 * @param c the code point to be tested
1783 * @return TRUE if the code point is an Ll lowercase letter
1785 * @see UCHAR_LOWERCASE
1790 U_STABLE UBool U_EXPORT2
1791 u_islower(UChar32 c);
1794 * Determines whether the specified code point has the general category "Lu"
1795 * (uppercase letter).
1797 * Same as java.lang.Character.isUpperCase().
1799 * This misses some characters that are also uppercase but
1800 * have a different general category value.
1801 * In order to include those, use UCHAR_UPPERCASE.
1803 * In addition to being equivalent to a Java function, this also serves
1804 * as a C/POSIX migration function.
1805 * See the comments about C/POSIX character classification functions in the
1806 * documentation at the top of this header file.
1808 * @param c the code point to be tested
1809 * @return TRUE if the code point is an Lu uppercase letter
1811 * @see UCHAR_UPPERCASE
1817 U_STABLE UBool U_EXPORT2
1818 u_isupper(UChar32 c);
1821 * Determines whether the specified code point is a titlecase letter.
1822 * True for general category "Lt" (titlecase letter).
1824 * Same as java.lang.Character.isTitleCase().
1826 * @param c the code point to be tested
1827 * @return TRUE if the code point is an Lt titlecase letter
1834 U_STABLE UBool U_EXPORT2
1835 u_istitle(UChar32 c);
1838 * Determines whether the specified code point is a digit character according to Java.
1839 * True for characters with general category "Nd" (decimal digit numbers).
1840 * Beginning with Unicode 4, this is the same as
1841 * testing for the Numeric_Type of Decimal.
1843 * Same as java.lang.Character.isDigit().
1845 * In addition to being equivalent to a Java function, this also serves
1846 * as a C/POSIX migration function.
1847 * See the comments about C/POSIX character classification functions in the
1848 * documentation at the top of this header file.
1850 * @param c the code point to be tested
1851 * @return TRUE if the code point is a digit character according to Character.isDigit()
1855 U_STABLE UBool U_EXPORT2
1856 u_isdigit(UChar32 c);
1859 * Determines whether the specified code point is a letter character.
1860 * True for general categories "L" (letters).
1862 * Same as java.lang.Character.isLetter().
1864 * In addition to being equivalent to a Java function, this also serves
1865 * as a C/POSIX migration function.
1866 * See the comments about C/POSIX character classification functions in the
1867 * documentation at the top of this header file.
1869 * @param c the code point to be tested
1870 * @return TRUE if the code point is a letter character
1876 U_STABLE UBool U_EXPORT2
1877 u_isalpha(UChar32 c);
1880 * Determines whether the specified code point is an alphanumeric character
1881 * (letter or digit) according to Java.
1882 * True for characters with general categories
1883 * "L" (letters) and "Nd" (decimal digit numbers).
1885 * Same as java.lang.Character.isLetterOrDigit().
1887 * In addition to being equivalent to a Java function, this also serves
1888 * as a C/POSIX migration function.
1889 * See the comments about C/POSIX character classification functions in the
1890 * documentation at the top of this header file.
1892 * @param c the code point to be tested
1893 * @return TRUE if the code point is an alphanumeric character according to Character.isLetterOrDigit()
1897 U_STABLE UBool U_EXPORT2
1898 u_isalnum(UChar32 c);
1901 * Determines whether the specified code point is a hexadecimal digit.
1902 * This is equivalent to u_digit(c, 16)>=0.
1903 * True for characters with general category "Nd" (decimal digit numbers)
1904 * as well as Latin letters a-f and A-F in both ASCII and Fullwidth ASCII.
1905 * (That is, for letters with code points
1906 * 0041..0046, 0061..0066, FF21..FF26, FF41..FF46.)
1908 * In order to narrow the definition of hexadecimal digits to only ASCII
1909 * characters, use (c<=0x7f && u_isxdigit(c)).
1911 * This is a C/POSIX migration function.
1912 * See the comments about C/POSIX character classification functions in the
1913 * documentation at the top of this header file.
1915 * @param c the code point to be tested
1916 * @return TRUE if the code point is a hexadecimal digit
1920 U_STABLE UBool U_EXPORT2
1921 u_isxdigit(UChar32 c);
1924 * Determines whether the specified code point is a punctuation character.
1925 * True for characters with general categories "P" (punctuation).
1927 * This is a C/POSIX migration function.
1928 * See the comments about C/POSIX character classification functions in the
1929 * documentation at the top of this header file.
1931 * @param c the code point to be tested
1932 * @return TRUE if the code point is a punctuation character
1936 U_STABLE UBool U_EXPORT2
1937 u_ispunct(UChar32 c);
1940 * Determines whether the specified code point is a "graphic" character
1941 * (printable, excluding spaces).
1942 * TRUE for all characters except those with general categories
1943 * "Cc" (control codes), "Cf" (format controls), "Cs" (surrogates),
1944 * "Cn" (unassigned), and "Z" (separators).
1946 * This is a C/POSIX migration function.
1947 * See the comments about C/POSIX character classification functions in the
1948 * documentation at the top of this header file.
1950 * @param c the code point to be tested
1951 * @return TRUE if the code point is a "graphic" character
1955 U_STABLE UBool U_EXPORT2
1956 u_isgraph(UChar32 c);
1959 * Determines whether the specified code point is a "blank" or "horizontal space",
1960 * a character that visibly separates words on a line.
1961 * The following are equivalent definitions:
1963 * TRUE for Unicode White_Space characters except for "vertical space controls"
1964 * where "vertical space controls" are the following characters:
1965 * U+000A (LF) U+000B (VT) U+000C (FF) U+000D (CR) U+0085 (NEL) U+2028 (LS) U+2029 (PS)
1969 * TRUE for U+0009 (TAB) and characters with general category "Zs" (space separators)
1970 * except Zero Width Space (ZWSP, U+200B).
1972 * Note: There are several ICU whitespace functions; please see the uchar.h
1973 * file documentation for a detailed comparison.
1975 * This is a C/POSIX migration function.
1976 * See the comments about C/POSIX character classification functions in the
1977 * documentation at the top of this header file.
1979 * @param c the code point to be tested
1980 * @return TRUE if the code point is a "blank"
1984 U_STABLE UBool U_EXPORT2
1985 u_isblank(UChar32 c);
1988 * Determines whether the specified code point is "defined",
1989 * which usually means that it is assigned a character.
1990 * True for general categories other than "Cn" (other, not assigned),
1991 * i.e., true for all code points mentioned in UnicodeData.txt.
1993 * Note that non-character code points (e.g., U+FDD0) are not "defined"
1994 * (they are Cn), but surrogate code points are "defined" (Cs).
1996 * Same as java.lang.Character.isDefined().
1998 * @param c the code point to be tested
1999 * @return TRUE if the code point is assigned a character
2009 U_STABLE UBool U_EXPORT2
2010 u_isdefined(UChar32 c);
2013 * Determines if the specified character is a space character or not.
2015 * Note: There are several ICU whitespace functions; please see the uchar.h
2016 * file documentation for a detailed comparison.
2018 * This is a C/POSIX migration function.
2019 * See the comments about C/POSIX character classification functions in the
2020 * documentation at the top of this header file.
2022 * @param c the character to be tested
2023 * @return true if the character is a space character; false otherwise.
2025 * @see u_isJavaSpaceChar
2026 * @see u_isWhitespace
2027 * @see u_isUWhiteSpace
2030 U_STABLE UBool U_EXPORT2
2031 u_isspace(UChar32 c);
2034 * Determine if the specified code point is a space character according to Java.
2035 * True for characters with general categories "Z" (separators),
2036 * which does not include control codes (e.g., TAB or Line Feed).
2038 * Same as java.lang.Character.isSpaceChar().
2040 * Note: There are several ICU whitespace functions; please see the uchar.h
2041 * file documentation for a detailed comparison.
2043 * @param c the code point to be tested
2044 * @return TRUE if the code point is a space character according to Character.isSpaceChar()
2047 * @see u_isWhitespace
2048 * @see u_isUWhiteSpace
2051 U_STABLE UBool U_EXPORT2
2052 u_isJavaSpaceChar(UChar32 c);
2055 * Determines if the specified code point is a whitespace character according to Java/ICU.
2056 * A character is considered to be a Java whitespace character if and only
2057 * if it satisfies one of the following criteria:
2059 * - It is a Unicode separator (categories "Z"), but is not
2060 * a no-break space (U+00A0 NBSP or U+2007 Figure Space or U+202F Narrow NBSP).
2061 * - It is U+0009 HORIZONTAL TABULATION.
2062 * - It is U+000A LINE FEED.
2063 * - It is U+000B VERTICAL TABULATION.
2064 * - It is U+000C FORM FEED.
2065 * - It is U+000D CARRIAGE RETURN.
2066 * - It is U+001C FILE SEPARATOR.
2067 * - It is U+001D GROUP SEPARATOR.
2068 * - It is U+001E RECORD SEPARATOR.
2069 * - It is U+001F UNIT SEPARATOR.
2070 * - It is U+0085 NEXT LINE.
2072 * Same as java.lang.Character.isWhitespace() except that Java omits U+0085.
2074 * Note: There are several ICU whitespace functions; please see the uchar.h
2075 * file documentation for a detailed comparison.
2077 * @param c the code point to be tested
2078 * @return TRUE if the code point is a whitespace character according to Java/ICU
2081 * @see u_isJavaSpaceChar
2082 * @see u_isUWhiteSpace
2085 U_STABLE UBool U_EXPORT2
2086 u_isWhitespace(UChar32 c);
2089 * Determines whether the specified code point is a control character
2090 * (as defined by this function).
2091 * A control character is one of the following:
2092 * - ISO 8-bit control character (U+0000..U+001f and U+007f..U+009f)
2093 * - U_CONTROL_CHAR (Cc)
2094 * - U_FORMAT_CHAR (Cf)
2095 * - U_LINE_SEPARATOR (Zl)
2096 * - U_PARAGRAPH_SEPARATOR (Zp)
2098 * This is a C/POSIX migration function.
2099 * See the comments about C/POSIX character classification functions in the
2100 * documentation at the top of this header file.
2102 * @param c the code point to be tested
2103 * @return TRUE if the code point is a control character
2105 * @see UCHAR_DEFAULT_IGNORABLE_CODE_POINT
2109 U_STABLE UBool U_EXPORT2
2110 u_iscntrl(UChar32 c);
2113 * Determines whether the specified code point is an ISO control code.
2114 * True for U+0000..U+001f and U+007f..U+009f (general category "Cc").
2116 * Same as java.lang.Character.isISOControl().
2118 * @param c the code point to be tested
2119 * @return TRUE if the code point is an ISO control code
2124 U_STABLE UBool U_EXPORT2
2125 u_isISOControl(UChar32 c);
2128 * Determines whether the specified code point is a printable character.
2129 * True for general categories <em>other</em> than "C" (controls).
2131 * This is a C/POSIX migration function.
2132 * See the comments about C/POSIX character classification functions in the
2133 * documentation at the top of this header file.
2135 * @param c the code point to be tested
2136 * @return TRUE if the code point is a printable character
2138 * @see UCHAR_DEFAULT_IGNORABLE_CODE_POINT
2142 U_STABLE UBool U_EXPORT2
2143 u_isprint(UChar32 c);
2146 * Determines whether the specified code point is a base character.
2147 * True for general categories "L" (letters), "N" (numbers),
2148 * "Mc" (spacing combining marks), and "Me" (enclosing marks).
2150 * Note that this is different from the Unicode definition in
2151 * chapter 3.5, conformance clause D13,
2152 * which defines base characters to be all characters (not Cn)
2153 * that do not graphically combine with preceding characters (M)
2154 * and that are neither control (Cc) or format (Cf) characters.
2156 * @param c the code point to be tested
2157 * @return TRUE if the code point is a base character according to this function
2163 U_STABLE UBool U_EXPORT2
2164 u_isbase(UChar32 c);
2167 * Returns the bidirectional category value for the code point,
2168 * which is used in the Unicode bidirectional algorithm
2169 * (UAX #9 http://www.unicode.org/reports/tr9/).
2170 * Note that some <em>unassigned</em> code points have bidi values
2171 * of R or AL because they are in blocks that are reserved
2172 * for Right-To-Left scripts.
2174 * Same as java.lang.Character.getDirectionality()
2176 * @param c the code point to be tested
2177 * @return the bidirectional category (UCharDirection) value
2179 * @see UCharDirection
2182 U_STABLE UCharDirection U_EXPORT2
2183 u_charDirection(UChar32 c);
2186 * Determines whether the code point has the Bidi_Mirrored property.
2187 * This property is set for characters that are commonly used in
2188 * Right-To-Left contexts and need to be displayed with a "mirrored"
2191 * Same as java.lang.Character.isMirrored().
2192 * Same as UCHAR_BIDI_MIRRORED
2194 * @param c the code point to be tested
2195 * @return TRUE if the character has the Bidi_Mirrored property
2197 * @see UCHAR_BIDI_MIRRORED
2200 U_STABLE UBool U_EXPORT2
2201 u_isMirrored(UChar32 c);
2204 * Maps the specified character to a "mirror-image" character.
2205 * For characters with the Bidi_Mirrored property, implementations
2206 * sometimes need a "poor man's" mapping to another Unicode
2207 * character (code point) such that the default glyph may serve
2208 * as the mirror-image of the default glyph of the specified
2209 * character. This is useful for text conversion to and from
2210 * codepages with visual order, and for displays without glyph
2211 * selecetion capabilities.
2213 * @param c the code point to be mapped
2214 * @return another Unicode code point that may serve as a mirror-image
2215 * substitute, or c itself if there is no such mapping or c
2216 * does not have the Bidi_Mirrored property
2218 * @see UCHAR_BIDI_MIRRORED
2222 U_STABLE UChar32 U_EXPORT2
2223 u_charMirror(UChar32 c);
2226 * Returns the general category value for the code point.
2228 * Same as java.lang.Character.getType().
2230 * @param c the code point to be tested
2231 * @return the general category (UCharCategory) value
2233 * @see UCharCategory
2236 U_STABLE int8_t U_EXPORT2
2237 u_charType(UChar32 c);
2240 * Get a single-bit bit set for the general category of a character.
2241 * This bit set can be compared bitwise with U_GC_SM_MASK, U_GC_L_MASK, etc.
2242 * Same as U_MASK(u_charType(c)).
2244 * @param c the code point to be tested
2245 * @return a single-bit mask corresponding to the general category (UCharCategory) value
2248 * @see UCharCategory
2252 #define U_GET_GC_MASK(c) U_MASK(u_charType(c))
2255 * Callback from u_enumCharTypes(), is called for each contiguous range
2256 * of code points c (where start<=c<limit)
2257 * with the same Unicode general category ("character type").
2259 * The callback function can stop the enumeration by returning FALSE.
2261 * @param context an opaque pointer, as passed into utrie_enum()
2262 * @param start the first code point in a contiguous range with value
2263 * @param limit one past the last code point in a contiguous range with value
2264 * @param type the general category for all code points in [start..limit[
2265 * @return FALSE to stop the enumeration
2268 * @see UCharCategory
2269 * @see u_enumCharTypes
2271 typedef UBool U_CALLCONV
2272 UCharEnumTypeRange(const void *context, UChar32 start, UChar32 limit, UCharCategory type);
2275 * Enumerate efficiently all code points with their Unicode general categories.
2277 * This is useful for building data structures (e.g., UnicodeSet's),
2278 * for enumerating all assigned code points (type!=U_UNASSIGNED), etc.
2280 * For each contiguous range of code points with a given general category ("character type"),
2281 * the UCharEnumTypeRange function is called.
2282 * Adjacent ranges have different types.
2283 * The Unicode Standard guarantees that the numeric value of the type is 0..31.
2285 * @param enumRange a pointer to a function that is called for each contiguous range
2286 * of code points with the same general category
2287 * @param context an opaque pointer that is passed on to the callback function
2290 * @see UCharCategory
2291 * @see UCharEnumTypeRange
2293 U_STABLE void U_EXPORT2
2294 u_enumCharTypes(UCharEnumTypeRange *enumRange, const void *context);
2296 #if !UCONFIG_NO_NORMALIZATION
2299 * Returns the combining class of the code point as specified in UnicodeData.txt.
2301 * @param c the code point of the character
2302 * @return the combining class of the character
2305 U_STABLE uint8_t U_EXPORT2
2306 u_getCombiningClass(UChar32 c);
2311 * Returns the decimal digit value of a decimal digit character.
2312 * Such characters have the general category "Nd" (decimal digit numbers)
2313 * and a Numeric_Type of Decimal.
2315 * Unlike ICU releases before 2.6, no digit values are returned for any
2316 * Han characters because Han number characters are often used with a special
2317 * Chinese-style number format (with characters for powers of 10 in between)
2318 * instead of in decimal-positional notation.
2319 * Unicode 4 explicitly assigns Han number characters the Numeric_Type
2320 * Numeric instead of Decimal.
2321 * See Jitterbug 1483 for more details.
2323 * Use u_getIntPropertyValue(c, UCHAR_NUMERIC_TYPE) and u_getNumericValue()
2324 * for complete numeric Unicode properties.
2326 * @param c the code point for which to get the decimal digit value
2327 * @return the decimal digit value of c,
2328 * or -1 if c is not a decimal digit character
2330 * @see u_getNumericValue
2333 U_STABLE int32_t U_EXPORT2
2334 u_charDigitValue(UChar32 c);
2337 * Returns the Unicode allocation block that contains the character.
2339 * @param c the code point to be tested
2340 * @return the block value (UBlockCode) for c
2345 U_STABLE UBlockCode U_EXPORT2
2346 ublock_getCode(UChar32 c);
2349 * Retrieve the name of a Unicode character.
2350 * Depending on <code>nameChoice</code>, the character name written
2351 * into the buffer is the "modern" name or the name that was defined
2352 * in Unicode version 1.0.
2353 * The name contains only "invariant" characters
2354 * like A-Z, 0-9, space, and '-'.
2355 * Unicode 1.0 names are only retrieved if they are different from the modern
2356 * names and if the data file contains the data for them. gennames may or may
2357 * not be called with a command line option to include 1.0 names in unames.dat.
2359 * @param code The character (code point) for which to get the name.
2360 * It must be <code>0<=code<=0x10ffff</code>.
2361 * @param nameChoice Selector for which name to get.
2362 * @param buffer Destination address for copying the name.
2363 * The name will always be zero-terminated.
2364 * If there is no name, then the buffer will be set to the empty string.
2365 * @param bufferLength <code>==sizeof(buffer)</code>
2366 * @param pErrorCode Pointer to a UErrorCode variable;
2367 * check for <code>U_SUCCESS()</code> after <code>u_charName()</code>
2369 * @return The length of the name, or 0 if there is no name for this character.
2370 * If the bufferLength is less than or equal to the length, then the buffer
2371 * contains the truncated name and the returned length indicates the full
2372 * length of the name.
2373 * The length does not include the zero-termination.
2375 * @see UCharNameChoice
2376 * @see u_charFromName
2377 * @see u_enumCharNames
2380 U_STABLE int32_t U_EXPORT2
2381 u_charName(UChar32 code, UCharNameChoice nameChoice,
2382 char *buffer, int32_t bufferLength,
2383 UErrorCode *pErrorCode);
2386 * Get the ISO 10646 comment for a character.
2387 * The ISO 10646 comment is an informative field in the Unicode Character
2388 * Database (UnicodeData.txt field 11) and is from the ISO 10646 names list.
2390 * @param c The character (code point) for which to get the ISO comment.
2391 * It must be <code>0<=c<=0x10ffff</code>.
2392 * @param dest Destination address for copying the comment.
2393 * The comment will be zero-terminated if possible.
2394 * If there is no comment, then the buffer will be set to the empty string.
2395 * @param destCapacity <code>==sizeof(dest)</code>
2396 * @param pErrorCode Pointer to a UErrorCode variable;
2397 * check for <code>U_SUCCESS()</code> after <code>u_getISOComment()</code>
2399 * @return The length of the comment, or 0 if there is no comment for this character.
2400 * If the destCapacity is less than or equal to the length, then the buffer
2401 * contains the truncated name and the returned length indicates the full
2402 * length of the name.
2403 * The length does not include the zero-termination.
2407 U_STABLE int32_t U_EXPORT2
2408 u_getISOComment(UChar32 c,
2409 char *dest, int32_t destCapacity,
2410 UErrorCode *pErrorCode);
2413 * Find a Unicode character by its name and return its code point value.
2414 * The name is matched exactly and completely.
2415 * If the name does not correspond to a code point, <i>pErrorCode</i>
2416 * is set to <code>U_INVALID_CHAR_FOUND</code>.
2417 * A Unicode 1.0 name is matched only if it differs from the modern name.
2418 * Unicode names are all uppercase. Extended names are lowercase followed
2419 * by an uppercase hexadecimal number, and within angle brackets.
2421 * @param nameChoice Selector for which name to match.
2422 * @param name The name to match.
2423 * @param pErrorCode Pointer to a UErrorCode variable
2424 * @return The Unicode value of the code point with the given name,
2425 * or an undefined value if there is no such code point.
2427 * @see UCharNameChoice
2429 * @see u_enumCharNames
2432 U_STABLE UChar32 U_EXPORT2
2433 u_charFromName(UCharNameChoice nameChoice,
2435 UErrorCode *pErrorCode);
2438 * Type of a callback function for u_enumCharNames() that gets called
2439 * for each Unicode character with the code point value and
2440 * the character name.
2441 * If such a function returns FALSE, then the enumeration is stopped.
2443 * @param context The context pointer that was passed to u_enumCharNames().
2444 * @param code The Unicode code point for the character with this name.
2445 * @param nameChoice Selector for which kind of names is enumerated.
2446 * @param name The character's name, zero-terminated.
2447 * @param length The length of the name.
2448 * @return TRUE if the enumeration should continue, FALSE to stop it.
2450 * @see UCharNameChoice
2451 * @see u_enumCharNames
2454 typedef UBool UEnumCharNamesFn(void *context,
2456 UCharNameChoice nameChoice,
2461 * Enumerate all assigned Unicode characters between the start and limit
2462 * code points (start inclusive, limit exclusive) and call a function
2463 * for each, passing the code point value and the character name.
2464 * For Unicode 1.0 names, only those are enumerated that differ from the
2467 * @param start The first code point in the enumeration range.
2468 * @param limit One more than the last code point in the enumeration range
2469 * (the first one after the range).
2470 * @param fn The function that is to be called for each character name.
2471 * @param context An arbitrary pointer that is passed to the function.
2472 * @param nameChoice Selector for which kind of names to enumerate.
2473 * @param pErrorCode Pointer to a UErrorCode variable
2475 * @see UCharNameChoice
2476 * @see UEnumCharNamesFn
2478 * @see u_charFromName
2481 U_STABLE void U_EXPORT2
2482 u_enumCharNames(UChar32 start, UChar32 limit,
2483 UEnumCharNamesFn *fn,
2485 UCharNameChoice nameChoice,
2486 UErrorCode *pErrorCode);
2489 * Return the Unicode name for a given property, as given in the
2490 * Unicode database file PropertyAliases.txt.
2492 * In addition, this function maps the property
2493 * UCHAR_GENERAL_CATEGORY_MASK to the synthetic names "gcm" /
2494 * "General_Category_Mask". These names are not in
2495 * PropertyAliases.txt.
2497 * @param property UProperty selector other than UCHAR_INVALID_CODE.
2498 * If out of range, NULL is returned.
2500 * @param nameChoice selector for which name to get. If out of range,
2501 * NULL is returned. All properties have a long name. Most
2502 * have a short name, but some do not. Unicode allows for
2503 * additional names; if present these will be returned by
2504 * U_LONG_PROPERTY_NAME + i, where i=1, 2,...
2506 * @return a pointer to the name, or NULL if either the
2507 * property or the nameChoice is out of range. If a given
2508 * nameChoice returns NULL, then all larger values of
2509 * nameChoice will return NULL, with one exception: if NULL is
2510 * returned for U_SHORT_PROPERTY_NAME, then
2511 * U_LONG_PROPERTY_NAME (and higher) may still return a
2512 * non-NULL value. The returned pointer is valid until
2513 * u_cleanup() is called.
2516 * @see UPropertyNameChoice
2519 U_STABLE const char* U_EXPORT2
2520 u_getPropertyName(UProperty property,
2521 UPropertyNameChoice nameChoice);
2524 * Return the UProperty enum for a given property name, as specified
2525 * in the Unicode database file PropertyAliases.txt. Short, long, and
2526 * any other variants are recognized.
2528 * In addition, this function maps the synthetic names "gcm" /
2529 * "General_Category_Mask" to the property
2530 * UCHAR_GENERAL_CATEGORY_MASK. These names are not in
2531 * PropertyAliases.txt.
2533 * @param alias the property name to be matched. The name is compared
2534 * using "loose matching" as described in PropertyAliases.txt.
2536 * @return a UProperty enum, or UCHAR_INVALID_CODE if the given name
2537 * does not match any property.
2542 U_STABLE UProperty U_EXPORT2
2543 u_getPropertyEnum(const char* alias);
2546 * Return the Unicode name for a given property value, as given in the
2547 * Unicode database file PropertyValueAliases.txt.
2549 * Note: Some of the names in PropertyValueAliases.txt can only be
2550 * retrieved using UCHAR_GENERAL_CATEGORY_MASK, not
2551 * UCHAR_GENERAL_CATEGORY. These include: "C" / "Other", "L" /
2552 * "Letter", "LC" / "Cased_Letter", "M" / "Mark", "N" / "Number", "P"
2553 * / "Punctuation", "S" / "Symbol", and "Z" / "Separator".
2555 * @param property UProperty selector constant.
2556 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT
2557 * or UCHAR_INT_START<=which<UCHAR_INT_LIMIT
2558 * or UCHAR_MASK_START<=which<UCHAR_MASK_LIMIT.
2559 * If out of range, NULL is returned.
2561 * @param value selector for a value for the given property. If out
2562 * of range, NULL is returned. In general, valid values range
2563 * from 0 up to some maximum. There are a few exceptions:
2564 * (1.) UCHAR_BLOCK values begin at the non-zero value
2565 * UBLOCK_BASIC_LATIN. (2.) UCHAR_CANONICAL_COMBINING_CLASS
2566 * values are not contiguous and range from 0..240. (3.)
2567 * UCHAR_GENERAL_CATEGORY_MASK values are not values of
2568 * UCharCategory, but rather mask values produced by
2569 * U_GET_GC_MASK(). This allows grouped categories such as
2570 * [:L:] to be represented. Mask values range
2571 * non-contiguously from 1..U_GC_P_MASK.
2573 * @param nameChoice selector for which name to get. If out of range,
2574 * NULL is returned. All values have a long name. Most have
2575 * a short name, but some do not. Unicode allows for
2576 * additional names; if present these will be returned by
2577 * U_LONG_PROPERTY_NAME + i, where i=1, 2,...
2579 * @return a pointer to the name, or NULL if either the
2580 * property or the nameChoice is out of range. If a given
2581 * nameChoice returns NULL, then all larger values of
2582 * nameChoice will return NULL, with one exception: if NULL is
2583 * returned for U_SHORT_PROPERTY_NAME, then
2584 * U_LONG_PROPERTY_NAME (and higher) may still return a
2585 * non-NULL value. The returned pointer is valid until
2586 * u_cleanup() is called.
2589 * @see UPropertyNameChoice
2592 U_STABLE const char* U_EXPORT2
2593 u_getPropertyValueName(UProperty property,
2595 UPropertyNameChoice nameChoice);
2598 * Return the property value integer for a given value name, as
2599 * specified in the Unicode database file PropertyValueAliases.txt.
2600 * Short, long, and any other variants are recognized.
2602 * Note: Some of the names in PropertyValueAliases.txt will only be
2603 * recognized with UCHAR_GENERAL_CATEGORY_MASK, not
2604 * UCHAR_GENERAL_CATEGORY. These include: "C" / "Other", "L" /
2605 * "Letter", "LC" / "Cased_Letter", "M" / "Mark", "N" / "Number", "P"
2606 * / "Punctuation", "S" / "Symbol", and "Z" / "Separator".
2608 * @param property UProperty selector constant.
2609 * Must be UCHAR_BINARY_START<=which<UCHAR_BINARY_LIMIT
2610 * or UCHAR_INT_START<=which<UCHAR_INT_LIMIT
2611 * or UCHAR_MASK_START<=which<UCHAR_MASK_LIMIT.
2612 * If out of range, UCHAR_INVALID_CODE is returned.
2614 * @param alias the value name to be matched. The name is compared
2615 * using "loose matching" as described in
2616 * PropertyValueAliases.txt.
2618 * @return a value integer or UCHAR_INVALID_CODE if the given name
2619 * does not match any value of the given property, or if the
2620 * property is invalid. Note: U CHAR_GENERAL_CATEGORY values
2621 * are not values of UCharCategory, but rather mask values
2622 * produced by U_GET_GC_MASK(). This allows grouped
2623 * categories such as [:L:] to be represented.
2628 U_STABLE int32_t U_EXPORT2
2629 u_getPropertyValueEnum(UProperty property,
2633 * Determines if the specified character is permissible as the
2634 * first character in an identifier according to Unicode
2635 * (The Unicode Standard, Version 3.0, chapter 5.16 Identifiers).
2636 * True for characters with general categories "L" (letters) and "Nl" (letter numbers).
2638 * Same as java.lang.Character.isUnicodeIdentifierStart().
2639 * Same as UCHAR_ID_START
2641 * @param c the code point to be tested
2642 * @return TRUE if the code point may start an identifier
2644 * @see UCHAR_ID_START
2649 U_STABLE UBool U_EXPORT2
2650 u_isIDStart(UChar32 c);
2653 * Determines if the specified character is permissible
2654 * in an identifier according to Java.
2655 * True for characters with general categories "L" (letters),
2656 * "Nl" (letter numbers), "Nd" (decimal digits),
2657 * "Mc" and "Mn" (combining marks), "Pc" (connecting punctuation), and
2658 * u_isIDIgnorable(c).
2660 * Same as java.lang.Character.isUnicodeIdentifierPart().
2661 * Almost the same as Unicode's ID_Continue (UCHAR_ID_CONTINUE)
2662 * except that Unicode recommends to ignore Cf which is less than
2663 * u_isIDIgnorable(c).
2665 * @param c the code point to be tested
2666 * @return TRUE if the code point may occur in an identifier according to Java
2668 * @see UCHAR_ID_CONTINUE
2670 * @see u_isIDIgnorable
2673 U_STABLE UBool U_EXPORT2
2674 u_isIDPart(UChar32 c);
2677 * Determines if the specified character should be regarded
2678 * as an ignorable character in an identifier,
2679 * according to Java.
2680 * True for characters with general category "Cf" (format controls) as well as
2681 * non-whitespace ISO controls
2682 * (U+0000..U+0008, U+000E..U+001B, U+007F..U+0084, U+0086..U+009F).
2684 * Same as java.lang.Character.isIdentifierIgnorable()
2685 * except that Java also returns TRUE for U+0085 Next Line
2686 * (it omits U+0085 from whitespace ISO controls).
2688 * Note that Unicode just recommends to ignore Cf (format controls).
2690 * @param c the code point to be tested
2691 * @return TRUE if the code point is ignorable in identifiers according to Java
2693 * @see UCHAR_DEFAULT_IGNORABLE_CODE_POINT
2698 U_STABLE UBool U_EXPORT2
2699 u_isIDIgnorable(UChar32 c);
2702 * Determines if the specified character is permissible as the
2703 * first character in a Java identifier.
2704 * In addition to u_isIDStart(c), true for characters with
2705 * general categories "Sc" (currency symbols) and "Pc" (connecting punctuation).
2707 * Same as java.lang.Character.isJavaIdentifierStart().
2709 * @param c the code point to be tested
2710 * @return TRUE if the code point may start a Java identifier
2712 * @see u_isJavaIDPart
2717 U_STABLE UBool U_EXPORT2
2718 u_isJavaIDStart(UChar32 c);
2721 * Determines if the specified character is permissible
2722 * in a Java identifier.
2723 * In addition to u_isIDPart(c), true for characters with
2724 * general category "Sc" (currency symbols).
2726 * Same as java.lang.Character.isJavaIdentifierPart().
2728 * @param c the code point to be tested
2729 * @return TRUE if the code point may occur in a Java identifier
2731 * @see u_isIDIgnorable
2732 * @see u_isJavaIDStart
2738 U_STABLE UBool U_EXPORT2
2739 u_isJavaIDPart(UChar32 c);
2742 * The given character is mapped to its lowercase equivalent according to
2743 * UnicodeData.txt; if the character has no lowercase equivalent, the character
2744 * itself is returned.
2746 * Same as java.lang.Character.toLowerCase().
2748 * This function only returns the simple, single-code point case mapping.
2749 * Full case mappings should be used whenever possible because they produce
2750 * better results by working on whole strings.
2751 * They take into account the string context and the language and can map
2752 * to a result string with a different length as appropriate.
2753 * Full case mappings are applied by the string case mapping functions,
2754 * see ustring.h and the UnicodeString class.
2755 * See also the User Guide chapter on C/POSIX migration:
2756 * http://icu.sourceforge.net/userguide/posix.html#case_mappings
2758 * @param c the code point to be mapped
2759 * @return the Simple_Lowercase_Mapping of the code point, if any;
2760 * otherwise the code point itself.
2763 U_STABLE UChar32 U_EXPORT2
2764 u_tolower(UChar32 c);
2767 * The given character is mapped to its uppercase equivalent according to UnicodeData.txt;
2768 * if the character has no uppercase equivalent, the character itself is
2771 * Same as java.lang.Character.toUpperCase().
2773 * This function only returns the simple, single-code point case mapping.
2774 * Full case mappings should be used whenever possible because they produce
2775 * better results by working on whole strings.
2776 * They take into account the string context and the language and can map
2777 * to a result string with a different length as appropriate.
2778 * Full case mappings are applied by the string case mapping functions,
2779 * see ustring.h and the UnicodeString class.
2780 * See also the User Guide chapter on C/POSIX migration:
2781 * http://icu.sourceforge.net/userguide/posix.html#case_mappings
2783 * @param c the code point to be mapped
2784 * @return the Simple_Uppercase_Mapping of the code point, if any;
2785 * otherwise the code point itself.
2788 U_STABLE UChar32 U_EXPORT2
2789 u_toupper(UChar32 c);
2792 * The given character is mapped to its titlecase equivalent
2793 * according to UnicodeData.txt;
2794 * if none is defined, the character itself is returned.
2796 * Same as java.lang.Character.toTitleCase().
2798 * This function only returns the simple, single-code point case mapping.
2799 * Full case mappings should be used whenever possible because they produce
2800 * better results by working on whole strings.
2801 * They take into account the string context and the language and can map
2802 * to a result string with a different length as appropriate.
2803 * Full case mappings are applied by the string case mapping functions,
2804 * see ustring.h and the UnicodeString class.
2805 * See also the User Guide chapter on C/POSIX migration:
2806 * http://icu.sourceforge.net/userguide/posix.html#case_mappings
2808 * @param c the code point to be mapped
2809 * @return the Simple_Titlecase_Mapping of the code point, if any;
2810 * otherwise the code point itself.
2813 U_STABLE UChar32 U_EXPORT2
2814 u_totitle(UChar32 c);
2816 /** Option value for case folding: use default mappings defined in CaseFolding.txt. @stable ICU 2.0 */
2817 #define U_FOLD_CASE_DEFAULT 0
2820 * Option value for case folding:
2822 * Use the modified set of mappings provided in CaseFolding.txt to handle dotted I
2823 * and dotless i appropriately for Turkic languages (tr, az).
2825 * Before Unicode 3.2, CaseFolding.txt contains mappings marked with 'I' that
2826 * are to be included for default mappings and
2827 * excluded for the Turkic-specific mappings.
2829 * Unicode 3.2 CaseFolding.txt instead contains mappings marked with 'T' that
2830 * are to be excluded for default mappings and
2831 * included for the Turkic-specific mappings.
2835 #define U_FOLD_CASE_EXCLUDE_SPECIAL_I 1
2838 * The given character is mapped to its case folding equivalent according to
2839 * UnicodeData.txt and CaseFolding.txt;
2840 * if the character has no case folding equivalent, the character
2841 * itself is returned.
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.sourceforge.net/userguide/posix.html#case_mappings
2853 * @param c the code point to be mapped
2854 * @param options Either U_FOLD_CASE_DEFAULT or U_FOLD_CASE_EXCLUDE_SPECIAL_I
2855 * @return the Simple_Case_Folding of the code point, if any;
2856 * otherwise the code point itself.
2859 U_STABLE UChar32 U_EXPORT2
2860 u_foldCase(UChar32 c, uint32_t options);
2863 * Returns the decimal digit value of the code point in the
2866 * If the radix is not in the range <code>2<=radix<=36</code> or if the
2867 * value of <code>c</code> is not a valid digit in the specified
2868 * radix, <code>-1</code> is returned. A character is a valid digit
2869 * if at least one of the following is true:
2871 * <li>The character has a decimal digit value.
2872 * Such characters have the general category "Nd" (decimal digit numbers)
2873 * and a Numeric_Type of Decimal.
2874 * In this case the value is the character's decimal digit value.</li>
2875 * <li>The character is one of the uppercase Latin letters
2876 * <code>'A'</code> through <code>'Z'</code>.
2877 * In this case the value is <code>c-'A'+10</code>.</li>
2878 * <li>The character is one of the lowercase Latin letters
2879 * <code>'a'</code> through <code>'z'</code>.
2880 * In this case the value is <code>ch-'a'+10</code>.</li>
2881 * <li>Latin letters from both the ASCII range (0061..007A, 0041..005A)
2882 * as well as from the Fullwidth ASCII range (FF41..FF5A, FF21..FF3A)
2883 * are recognized.</li>
2886 * Same as java.lang.Character.digit().
2888 * @param ch the code point to be tested.
2889 * @param radix the radix.
2890 * @return the numeric value represented by the character in the
2892 * or -1 if there is no value or if the value exceeds the radix.
2894 * @see UCHAR_NUMERIC_TYPE
2896 * @see u_charDigitValue
2900 U_STABLE int32_t U_EXPORT2
2901 u_digit(UChar32 ch, int8_t radix);
2904 * Determines the character representation for a specific digit in
2905 * the specified radix. If the value of <code>radix</code> is not a
2906 * valid radix, or the value of <code>digit</code> is not a valid
2907 * digit in the specified radix, the null character
2908 * (<code>U+0000</code>) is returned.
2910 * The <code>radix</code> argument is valid if it is greater than or
2911 * equal to 2 and less than or equal to 36.
2912 * The <code>digit</code> argument is valid if
2913 * <code>0 <= digit < radix</code>.
2915 * If the digit is less than 10, then
2916 * <code>'0' + digit</code> is returned. Otherwise, the value
2917 * <code>'a' + digit - 10</code> is returned.
2919 * Same as java.lang.Character.forDigit().
2921 * @param digit the number to convert to a character.
2922 * @param radix the radix.
2923 * @return the <code>char</code> representation of the specified digit
2924 * in the specified radix.
2927 * @see u_charDigitValue
2931 U_STABLE UChar32 U_EXPORT2
2932 u_forDigit(int32_t digit, int8_t radix);
2935 * Get the "age" of the code point.
2936 * The "age" is the Unicode version when the code point was first
2937 * designated (as a non-character or for Private Use)
2938 * or assigned a character.
2939 * This can be useful to avoid emitting code points to receiving
2940 * processes that do not accept newer characters.
2941 * The data is from the UCD file DerivedAge.txt.
2943 * @param c The code point.
2944 * @param versionArray The Unicode version number array, to be filled in.
2948 U_STABLE void U_EXPORT2
2949 u_charAge(UChar32 c, UVersionInfo versionArray);
2952 * Gets the Unicode version information.
2953 * The version array is filled in with the version information
2954 * for the Unicode standard that is currently used by ICU.
2955 * For example, Unicode version 3.1.1 is represented as an array with
2956 * the values { 3, 1, 1, 0 }.
2958 * @param versionArray an output array that will be filled in with
2959 * the Unicode version number
2962 U_STABLE void U_EXPORT2
2963 u_getUnicodeVersion(UVersionInfo versionArray);
2966 * Get the FC_NFKC_Closure property string for a character.
2967 * See Unicode Standard Annex #15 for details, search for "FC_NFKC_Closure"
2968 * or for "FNC": http://www.unicode.org/reports/tr15/
2970 * @param c The character (code point) for which to get the FC_NFKC_Closure string.
2971 * It must be <code>0<=c<=0x10ffff</code>.
2972 * @param dest Destination address for copying the string.
2973 * The string will be zero-terminated if possible.
2974 * If there is no FC_NFKC_Closure string,
2975 * then the buffer will be set to the empty string.
2976 * @param destCapacity <code>==sizeof(dest)</code>
2977 * @param pErrorCode Pointer to a UErrorCode variable.
2978 * @return The length of the string, or 0 if there is no FC_NFKC_Closure string for this character.
2979 * If the destCapacity is less than or equal to the length, then the buffer
2980 * contains the truncated name and the returned length indicates the full
2981 * length of the name.
2982 * The length does not include the zero-termination.
2986 U_STABLE int32_t U_EXPORT2
2987 u_getFC_NFKC_Closure(UChar32 c, UChar *dest, int32_t destCapacity, UErrorCode *pErrorCode);