1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
3 <!-- Created on March, 30 2010 by texi2html 1.78a -->
5 Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
6 Karl Berry <karl@freefriends.org>
7 Olaf Bachmann <obachman@mathematik.uni-kl.de>
9 Maintained by: Many creative people.
10 Send bugs and suggestions to <texi2html-bug@nongnu.org>
14 <title>GNU libunistring: 8. Unicode character classification and properties <unictype.h></title>
16 <meta name="description" content="GNU libunistring: 8. Unicode character classification and properties <unictype.h>">
17 <meta name="keywords" content="GNU libunistring: 8. Unicode character classification and properties <unictype.h>">
18 <meta name="resource-type" content="document">
19 <meta name="distribution" content="global">
20 <meta name="Generator" content="texi2html 1.78a">
21 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
22 <style type="text/css">
24 a.summary-letter {text-decoration: none}
25 pre.display {font-family: serif}
26 pre.format {font-family: serif}
27 pre.menu-comment {font-family: serif}
28 pre.menu-preformatted {font-family: serif}
29 pre.smalldisplay {font-family: serif; font-size: smaller}
30 pre.smallexample {font-size: smaller}
31 pre.smallformat {font-family: serif; font-size: smaller}
32 pre.smalllisp {font-size: smaller}
33 span.roman {font-family:serif; font-weight:normal;}
34 span.sansserif {font-family:sans-serif; font-weight:normal;}
35 ul.toc {list-style: none}
42 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
44 <table cellpadding="1" cellspacing="1" border="0">
45 <tr><td valign="middle" align="left">[<a href="libunistring_7.html#SEC19" title="Beginning of this chapter or previous chapter"> << </a>]</td>
46 <td valign="middle" align="left">[<a href="libunistring_9.html#SEC37" title="Next chapter"> >> </a>]</td>
47 <td valign="middle" align="left"> </td>
48 <td valign="middle" align="left"> </td>
49 <td valign="middle" align="left"> </td>
50 <td valign="middle" align="left"> </td>
51 <td valign="middle" align="left"> </td>
52 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
53 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
54 <td valign="middle" align="left">[<a href="libunistring_18.html#SEC71" title="Index">Index</a>]</td>
55 <td valign="middle" align="left">[<a href="libunistring_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
59 <a name="unictype_002eh"></a>
61 <h1 class="chapter"> <a href="libunistring.html#TOC20">8. Unicode character classification and properties <code><unictype.h></code></a> </h1>
63 <p>This include file declares functions that classify Unicode characters
64 and that test whether Unicode characters have specific properties.
66 <p>The classification assigns a “general category” to every Unicode
67 character. This is similar to the classification provided by ISO C in
68 <code><wctype.h></code>.
70 <p>Properties are the data that guides various text processing algorithms
71 in the presence of specific Unicode characters.
75 <a name="General-category"></a>
77 <h2 class="section"> <a href="libunistring.html#TOC21">8.1 General category</a> </h2>
79 <p>Every Unicode character or code point has a <em>general category</em> assigned
80 to it. This classification is important for most algorithms that work on
83 <p>The GNU libunistring library provides two kinds of API for working with
84 general categories. The object oriented API uses a variable to denote
85 every predefined general category value or combinations thereof. The
86 low-level API uses a bit mask instead. The advantage of the object oriented
87 API is that if only a few predefined general category values are used,
88 the data tables are relatively small. When you combine general category
89 values (using <code>uc_general_category_or</code>, <code>uc_general_category_and</code>,
90 or <code>uc_general_category_and_not</code>), or when you use the low level
91 bit masks, a big table is used thats holds the complete general category
92 information for all Unicode characters.
96 <a name="Object-oriented-API"></a>
98 <h3 class="subsection"> <a href="libunistring.html#TOC22">8.1.1 The object oriented API for general category</a> </h3>
101 <dt><u>Type:</u> <b>uc_general_category_t</b>
102 <a name="IDX241"></a>
104 <dd><p>This data type denotes a general category value. It is an immediate type that
105 can be copied by simple assignment, without involving memory allocation. It is
109 <p>The following are the predefined general category value. Additional general
110 categories may be added in the future.
113 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_L</b>
114 <a name="IDX242"></a>
116 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Lu</b>
117 <a name="IDX243"></a>
119 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Ll</b>
120 <a name="IDX244"></a>
122 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Lt</b>
123 <a name="IDX245"></a>
125 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Lm</b>
126 <a name="IDX246"></a>
128 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Lo</b>
129 <a name="IDX247"></a>
131 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_M</b>
132 <a name="IDX248"></a>
134 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Mn</b>
135 <a name="IDX249"></a>
137 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Mc</b>
138 <a name="IDX250"></a>
140 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Me</b>
141 <a name="IDX251"></a>
143 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_N</b>
144 <a name="IDX252"></a>
146 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Nd</b>
147 <a name="IDX253"></a>
149 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Nl</b>
150 <a name="IDX254"></a>
152 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_No</b>
153 <a name="IDX255"></a>
155 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_P</b>
156 <a name="IDX256"></a>
158 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Pc</b>
159 <a name="IDX257"></a>
161 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Pd</b>
162 <a name="IDX258"></a>
164 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Ps</b>
165 <a name="IDX259"></a>
167 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Pe</b>
168 <a name="IDX260"></a>
170 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Pi</b>
171 <a name="IDX261"></a>
173 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Pf</b>
174 <a name="IDX262"></a>
176 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Po</b>
177 <a name="IDX263"></a>
179 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_S</b>
180 <a name="IDX264"></a>
182 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Sm</b>
183 <a name="IDX265"></a>
185 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Sc</b>
186 <a name="IDX266"></a>
188 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Sk</b>
189 <a name="IDX267"></a>
191 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_So</b>
192 <a name="IDX268"></a>
194 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Z</b>
195 <a name="IDX269"></a>
197 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Zs</b>
198 <a name="IDX270"></a>
200 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Zl</b>
201 <a name="IDX271"></a>
203 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Zp</b>
204 <a name="IDX272"></a>
206 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_C</b>
207 <a name="IDX273"></a>
209 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Cc</b>
210 <a name="IDX274"></a>
212 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Cf</b>
213 <a name="IDX275"></a>
215 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Cs</b>
216 <a name="IDX276"></a>
218 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Co</b>
219 <a name="IDX277"></a>
221 <dt><u>Constant:</u> uc_general_category_t <b>UC_CATEGORY_Cn</b>
222 <a name="IDX278"></a>
226 <p>The following are alias names for predefined General category values.
229 <dt><u>Macro:</u> uc_general_category_t <b>UC_LETTER</b>
230 <a name="IDX279"></a>
232 <dd><p>This is another name for <code>UC_CATEGORY_L</code>.
236 <dt><u>Macro:</u> uc_general_category_t <b>UC_UPPERCASE_LETTER</b>
237 <a name="IDX280"></a>
239 <dd><p>This is another name for <code>UC_CATEGORY_Lu</code>.
243 <dt><u>Macro:</u> uc_general_category_t <b>UC_LOWERCASE_LETTER</b>
244 <a name="IDX281"></a>
246 <dd><p>This is another name for <code>UC_CATEGORY_Ll</code>.
250 <dt><u>Macro:</u> uc_general_category_t <b>UC_TITLECASE_LETTER</b>
251 <a name="IDX282"></a>
253 <dd><p>This is another name for <code>UC_CATEGORY_Lt</code>.
257 <dt><u>Macro:</u> uc_general_category_t <b>UC_MODIFIER_LETTER</b>
258 <a name="IDX283"></a>
260 <dd><p>This is another name for <code>UC_CATEGORY_Lm</code>.
264 <dt><u>Macro:</u> uc_general_category_t <b>UC_OTHER_LETTER</b>
265 <a name="IDX284"></a>
267 <dd><p>This is another name for <code>UC_CATEGORY_Lo</code>.
271 <dt><u>Macro:</u> uc_general_category_t <b>UC_MARK</b>
272 <a name="IDX285"></a>
274 <dd><p>This is another name for <code>UC_CATEGORY_M</code>.
278 <dt><u>Macro:</u> uc_general_category_t <b>UC_NON_SPACING_MARK</b>
279 <a name="IDX286"></a>
281 <dd><p>This is another name for <code>UC_CATEGORY_Mn</code>.
285 <dt><u>Macro:</u> uc_general_category_t <b>UC_COMBINING_SPACING_MARK</b>
286 <a name="IDX287"></a>
288 <dd><p>This is another name for <code>UC_CATEGORY_Mc</code>.
292 <dt><u>Macro:</u> uc_general_category_t <b>UC_ENCLOSING_MARK</b>
293 <a name="IDX288"></a>
295 <dd><p>This is another name for <code>UC_CATEGORY_Me</code>.
299 <dt><u>Macro:</u> uc_general_category_t <b>UC_NUMBER</b>
300 <a name="IDX289"></a>
302 <dd><p>This is another name for <code>UC_CATEGORY_N</code>.
306 <dt><u>Macro:</u> uc_general_category_t <b>UC_DECIMAL_DIGIT_NUMBER</b>
307 <a name="IDX290"></a>
309 <dd><p>This is another name for <code>UC_CATEGORY_Nd</code>.
313 <dt><u>Macro:</u> uc_general_category_t <b>UC_LETTER_NUMBER</b>
314 <a name="IDX291"></a>
316 <dd><p>This is another name for <code>UC_CATEGORY_Nl</code>.
320 <dt><u>Macro:</u> uc_general_category_t <b>UC_OTHER_NUMBER</b>
321 <a name="IDX292"></a>
323 <dd><p>This is another name for <code>UC_CATEGORY_No</code>.
327 <dt><u>Macro:</u> uc_general_category_t <b>UC_PUNCTUATION</b>
328 <a name="IDX293"></a>
330 <dd><p>This is another name for <code>UC_CATEGORY_P</code>.
334 <dt><u>Macro:</u> uc_general_category_t <b>UC_CONNECTOR_PUNCTUATION</b>
335 <a name="IDX294"></a>
337 <dd><p>This is another name for <code>UC_CATEGORY_Pc</code>.
341 <dt><u>Macro:</u> uc_general_category_t <b>UC_DASH_PUNCTUATION</b>
342 <a name="IDX295"></a>
344 <dd><p>This is another name for <code>UC_CATEGORY_Pd</code>.
348 <dt><u>Macro:</u> uc_general_category_t <b>UC_OPEN_PUNCTUATION</b>
349 <a name="IDX296"></a>
351 <dd><p>This is another name for <code>UC_CATEGORY_Ps</code> (“start punctuation”).
355 <dt><u>Macro:</u> uc_general_category_t <b>UC_CLOSE_PUNCTUATION</b>
356 <a name="IDX297"></a>
358 <dd><p>This is another name for <code>UC_CATEGORY_Pe</code> (“end punctuation”).
362 <dt><u>Macro:</u> uc_general_category_t <b>UC_INITIAL_QUOTE_PUNCTUATION</b>
363 <a name="IDX298"></a>
365 <dd><p>This is another name for <code>UC_CATEGORY_Pi</code>.
369 <dt><u>Macro:</u> uc_general_category_t <b>UC_FINAL_QUOTE_PUNCTUATION</b>
370 <a name="IDX299"></a>
372 <dd><p>This is another name for <code>UC_CATEGORY_Pf</code>.
376 <dt><u>Macro:</u> uc_general_category_t <b>UC_OTHER_PUNCTUATION</b>
377 <a name="IDX300"></a>
379 <dd><p>This is another name for <code>UC_CATEGORY_Po</code>.
383 <dt><u>Macro:</u> uc_general_category_t <b>UC_SYMBOL</b>
384 <a name="IDX301"></a>
386 <dd><p>This is another name for <code>UC_CATEGORY_S</code>.
390 <dt><u>Macro:</u> uc_general_category_t <b>UC_MATH_SYMBOL</b>
391 <a name="IDX302"></a>
393 <dd><p>This is another name for <code>UC_CATEGORY_Sm</code>.
397 <dt><u>Macro:</u> uc_general_category_t <b>UC_CURRENCY_SYMBOL</b>
398 <a name="IDX303"></a>
400 <dd><p>This is another name for <code>UC_CATEGORY_Sc</code>.
404 <dt><u>Macro:</u> uc_general_category_t <b>UC_MODIFIER_SYMBOL</b>
405 <a name="IDX304"></a>
407 <dd><p>This is another name for <code>UC_CATEGORY_Sk</code>.
411 <dt><u>Macro:</u> uc_general_category_t <b>UC_OTHER_SYMBOL</b>
412 <a name="IDX305"></a>
414 <dd><p>This is another name for <code>UC_CATEGORY_So</code>.
418 <dt><u>Macro:</u> uc_general_category_t <b>UC_SEPARATOR</b>
419 <a name="IDX306"></a>
421 <dd><p>This is another name for <code>UC_CATEGORY_Z</code>.
425 <dt><u>Macro:</u> uc_general_category_t <b>UC_SPACE_SEPARATOR</b>
426 <a name="IDX307"></a>
428 <dd><p>This is another name for <code>UC_CATEGORY_Zs</code>.
432 <dt><u>Macro:</u> uc_general_category_t <b>UC_LINE_SEPARATOR</b>
433 <a name="IDX308"></a>
435 <dd><p>This is another name for <code>UC_CATEGORY_Zl</code>.
439 <dt><u>Macro:</u> uc_general_category_t <b>UC_PARAGRAPH_SEPARATOR</b>
440 <a name="IDX309"></a>
442 <dd><p>This is another name for <code>UC_CATEGORY_Zp</code>.
446 <dt><u>Macro:</u> uc_general_category_t <b>UC_OTHER</b>
447 <a name="IDX310"></a>
449 <dd><p>This is another name for <code>UC_CATEGORY_C</code>.
453 <dt><u>Macro:</u> uc_general_category_t <b>UC_CONTROL</b>
454 <a name="IDX311"></a>
456 <dd><p>This is another name for <code>UC_CATEGORY_Cc</code>.
460 <dt><u>Macro:</u> uc_general_category_t <b>UC_FORMAT</b>
461 <a name="IDX312"></a>
463 <dd><p>This is another name for <code>UC_CATEGORY_Cf</code>.
467 <dt><u>Macro:</u> uc_general_category_t <b>UC_SURROGATE</b>
468 <a name="IDX313"></a>
470 <dd><p>This is another name for <code>UC_CATEGORY_Cs</code>. All code points in this
471 category are invalid characters.
475 <dt><u>Macro:</u> uc_general_category_t <b>UC_PRIVATE_USE</b>
476 <a name="IDX314"></a>
478 <dd><p>This is another name for <code>UC_CATEGORY_Co</code>.
482 <dt><u>Macro:</u> uc_general_category_t <b>UC_UNASSIGNED</b>
483 <a name="IDX315"></a>
485 <dd><p>This is another name for <code>UC_CATEGORY_Cn</code>. Some code points in this
486 category are invalid characters.
489 <p>The following functions combine general categories, like in a boolean algebra,
490 except that there is no ‘<samp>not</samp>’ operation.
493 <dt><u>Function:</u> uc_general_category_t <b>uc_general_category_or</b><i> (uc_general_category_t <var>category1</var>, uc_general_category_t <var>category2</var>)</i>
494 <a name="IDX316"></a>
496 <dd><p>Returns the union of two general categories.
497 This corresponds to the unions of the two sets of characters.
501 <dt><u>Function:</u> uc_general_category_t <b>uc_general_category_and</b><i> (uc_general_category_t <var>category1</var>, uc_general_category_t <var>category2</var>)</i>
502 <a name="IDX317"></a>
504 <dd><p>Returns the intersection of two general categories as bit masks.
505 This <em>does not</em> correspond to the intersection of the two sets of
510 <dt><u>Function:</u> uc_general_category_t <b>uc_general_category_and_not</b><i> (uc_general_category_t <var>category1</var>, uc_general_category_t <var>category2</var>)</i>
511 <a name="IDX318"></a>
513 <dd><p>Returns the intersection of a general category with the complement of a
514 second general category, as bit masks.
515 This <em>does not</em> correspond to the intersection with complement, when
516 viewing the categories as sets of characters.
519 <p>The following functions associate general categories with their name.
522 <dt><u>Function:</u> const char * <b>uc_general_category_name</b><i> (uc_general_category_t <var>category</var>)</i>
523 <a name="IDX319"></a>
525 <dd><p>Returns the name of a general category.
526 Returns NULL if the general category corresponds to a bit mask that does not
531 <dt><u>Function:</u> uc_general_category_t <b>uc_general_category_byname</b><i> (const char *<var>category_name</var>)</i>
532 <a name="IDX320"></a>
534 <dd><p>Returns the general category given by name, e.g. <code>"Lu"</code>.
537 <p>The following functions view general categories as sets of Unicode characters.
540 <dt><u>Function:</u> uc_general_category_t <b>uc_general_category</b><i> (ucs4_t <var>uc</var>)</i>
541 <a name="IDX321"></a>
543 <dd><p>Returns the general category of a Unicode character.
545 <p>This function uses a big table.
549 <dt><u>Function:</u> bool <b>uc_is_general_category</b><i> (ucs4_t <var>uc</var>, uc_general_category_t <var>category</var>)</i>
550 <a name="IDX322"></a>
552 <dd><p>Tests whether a Unicode character belongs to a given category.
553 The <var>category</var> argument can be a predefined general category or the
554 combination of several predefined general categories.
558 <a name="Bit-mask-API"></a>
560 <h3 class="subsection"> <a href="libunistring.html#TOC23">8.1.2 The bit mask API for general category</a> </h3>
562 <p>The following are the predefined general category value as bit masks.
563 Additional general categories may be added in the future.
566 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_L</b>
567 <a name="IDX323"></a>
569 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Lu</b>
570 <a name="IDX324"></a>
572 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Ll</b>
573 <a name="IDX325"></a>
575 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Lt</b>
576 <a name="IDX326"></a>
578 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Lm</b>
579 <a name="IDX327"></a>
581 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Lo</b>
582 <a name="IDX328"></a>
584 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_M</b>
585 <a name="IDX329"></a>
587 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Mn</b>
588 <a name="IDX330"></a>
590 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Mc</b>
591 <a name="IDX331"></a>
593 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Me</b>
594 <a name="IDX332"></a>
596 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_N</b>
597 <a name="IDX333"></a>
599 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Nd</b>
600 <a name="IDX334"></a>
602 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Nl</b>
603 <a name="IDX335"></a>
605 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_No</b>
606 <a name="IDX336"></a>
608 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_P</b>
609 <a name="IDX337"></a>
611 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Pc</b>
612 <a name="IDX338"></a>
614 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Pd</b>
615 <a name="IDX339"></a>
617 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Ps</b>
618 <a name="IDX340"></a>
620 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Pe</b>
621 <a name="IDX341"></a>
623 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Pi</b>
624 <a name="IDX342"></a>
626 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Pf</b>
627 <a name="IDX343"></a>
629 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Po</b>
630 <a name="IDX344"></a>
632 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_S</b>
633 <a name="IDX345"></a>
635 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Sm</b>
636 <a name="IDX346"></a>
638 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Sc</b>
639 <a name="IDX347"></a>
641 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Sk</b>
642 <a name="IDX348"></a>
644 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_So</b>
645 <a name="IDX349"></a>
647 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Z</b>
648 <a name="IDX350"></a>
650 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Zs</b>
651 <a name="IDX351"></a>
653 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Zl</b>
654 <a name="IDX352"></a>
656 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Zp</b>
657 <a name="IDX353"></a>
659 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_C</b>
660 <a name="IDX354"></a>
662 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Cc</b>
663 <a name="IDX355"></a>
665 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Cf</b>
666 <a name="IDX356"></a>
668 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Cs</b>
669 <a name="IDX357"></a>
671 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Co</b>
672 <a name="IDX358"></a>
674 <dt><u>Macro:</u> uint32_t <b>UC_CATEGORY_MASK_Cn</b>
675 <a name="IDX359"></a>
679 <p>The following function views general categories as sets of Unicode characters.
682 <dt><u>Function:</u> bool <b>uc_is_general_category_withtable</b><i> (ucs4_t <var>uc</var>, uint32_t <var>bitmask</var>)</i>
683 <a name="IDX360"></a>
685 <dd><p>Tests whether a Unicode character belongs to a given category.
686 The <var>bitmask</var> argument can be a predefined general category bitmask or the
687 combination of several predefined general category bitmasks.
689 <p>This function uses a big table comprising all general categories.
693 <a name="Canonical-combining-class"></a>
695 <h2 class="section"> <a href="libunistring.html#TOC24">8.2 Canonical combining class</a> </h2>
697 <p>Every Unicode character or code point has a <em>canonical combining class</em>
700 <p>What is the meaning of the canonical combining class? Essentially, it
701 indicates the priority with which a combining character is attached to its
702 base character. The characters for which the canonical combining class is 0
703 are the base characters, and the characters for which it is greater than 0 are
704 the combining characters. Combining characters are rendered
705 near/attached/around their base character, and combining characters with small
706 combining classes are attached "first" or "closer" to the base character.
708 <p>The canonical combining class of a character is a number in the range
709 0..255. The possible values are described in the Unicode Character Database
710 <a href="http://www.unicode.org/Public/UNIDATA/UCD.html">http://www.unicode.org/Public/UNIDATA/UCD.html</a>. The list here is
711 not definitive; more values can be added in future versions.
714 <dt><u>Constant:</u> int <b>UC_CCC_NR</b>
715 <a name="IDX361"></a>
717 <dd><p>The canonical combining class value for “Not Reordered” characters.
722 <dt><u>Constant:</u> int <b>UC_CCC_OV</b>
723 <a name="IDX362"></a>
725 <dd><p>The canonical combining class value for “Overlay” characters.
729 <dt><u>Constant:</u> int <b>UC_CCC_NK</b>
730 <a name="IDX363"></a>
732 <dd><p>The canonical combining class value for “Nukta” characters.
736 <dt><u>Constant:</u> int <b>UC_CCC_KV</b>
737 <a name="IDX364"></a>
739 <dd><p>The canonical combining class value for “Kana Voicing” characters.
743 <dt><u>Constant:</u> int <b>UC_CCC_VR</b>
744 <a name="IDX365"></a>
746 <dd><p>The canonical combining class value for “Virama” characters.
750 <dt><u>Constant:</u> int <b>UC_CCC_ATBL</b>
751 <a name="IDX366"></a>
753 <dd><p>The canonical combining class value for “Attached Below Left” characters.
757 <dt><u>Constant:</u> int <b>UC_CCC_ATB</b>
758 <a name="IDX367"></a>
760 <dd><p>The canonical combining class value for “Attached Below” characters.
764 <dt><u>Constant:</u> int <b>UC_CCC_ATAR</b>
765 <a name="IDX368"></a>
767 <dd><p>The canonical combining class value for “Attached Above Right” characters.
771 <dt><u>Constant:</u> int <b>UC_CCC_BL</b>
772 <a name="IDX369"></a>
774 <dd><p>The canonical combining class value for “Below Left” characters.
778 <dt><u>Constant:</u> int <b>UC_CCC_B</b>
779 <a name="IDX370"></a>
781 <dd><p>The canonical combining class value for “Below” characters.
785 <dt><u>Constant:</u> int <b>UC_CCC_BR</b>
786 <a name="IDX371"></a>
788 <dd><p>The canonical combining class value for “Below Right” characters.
792 <dt><u>Constant:</u> int <b>UC_CCC_L</b>
793 <a name="IDX372"></a>
795 <dd><p>The canonical combining class value for “Left” characters.
799 <dt><u>Constant:</u> int <b>UC_CCC_R</b>
800 <a name="IDX373"></a>
802 <dd><p>The canonical combining class value for “Right” characters.
806 <dt><u>Constant:</u> int <b>UC_CCC_AL</b>
807 <a name="IDX374"></a>
809 <dd><p>The canonical combining class value for “Above Left” characters.
813 <dt><u>Constant:</u> int <b>UC_CCC_A</b>
814 <a name="IDX375"></a>
816 <dd><p>The canonical combining class value for “Above” characters.
820 <dt><u>Constant:</u> int <b>UC_CCC_AR</b>
821 <a name="IDX376"></a>
823 <dd><p>The canonical combining class value for “Above Right” characters.
827 <dt><u>Constant:</u> int <b>UC_CCC_DB</b>
828 <a name="IDX377"></a>
830 <dd><p>The canonical combining class value for “Double Below” characters.
834 <dt><u>Constant:</u> int <b>UC_CCC_DA</b>
835 <a name="IDX378"></a>
837 <dd><p>The canonical combining class value for “Double Above” characters.
841 <dt><u>Constant:</u> int <b>UC_CCC_IS</b>
842 <a name="IDX379"></a>
844 <dd><p>The canonical combining class value for “Iota Subscript” characters.
847 <p>The following function looks up the canonical combining class of a character.
850 <dt><u>Function:</u> int <b>uc_combining_class</b><i> (ucs4_t <var>uc</var>)</i>
851 <a name="IDX380"></a>
853 <dd><p>Returns the canonical combining class of a Unicode character.
857 <a name="Bidirectional-category"></a>
859 <h2 class="section"> <a href="libunistring.html#TOC25">8.3 Bidirectional category</a> </h2>
861 <p>Every Unicode character or code point has a <em>bidirectional category</em>
864 <p>The bidirectional category guides the bidirectional algorithm
865 (<a href="http://www.unicode.org/reports/tr9/">http://www.unicode.org/reports/tr9/</a>). The possible values are
869 <dt><u>Constant:</u> int <b>UC_BIDI_L</b>
870 <a name="IDX381"></a>
872 <dd><p>The bidirectional category for `Left-to-Right`” characters.
876 <dt><u>Constant:</u> int <b>UC_BIDI_LRE</b>
877 <a name="IDX382"></a>
879 <dd><p>The bidirectional category for “Left-to-Right Embedding” characters.
883 <dt><u>Constant:</u> int <b>UC_BIDI_LRO</b>
884 <a name="IDX383"></a>
886 <dd><p>The bidirectional category for “Left-to-Right Override” characters.
890 <dt><u>Constant:</u> int <b>UC_BIDI_R</b>
891 <a name="IDX384"></a>
893 <dd><p>The bidirectional category for “Right-to-Left” characters.
897 <dt><u>Constant:</u> int <b>UC_BIDI_AL</b>
898 <a name="IDX385"></a>
900 <dd><p>The bidirectional category for “Right-to-Left Arabic” characters.
904 <dt><u>Constant:</u> int <b>UC_BIDI_RLE</b>
905 <a name="IDX386"></a>
907 <dd><p>The bidirectional category for “Right-to-Left Embedding” characters.
911 <dt><u>Constant:</u> int <b>UC_BIDI_RLO</b>
912 <a name="IDX387"></a>
914 <dd><p>The bidirectional category for “Right-to-Left Override” characters.
918 <dt><u>Constant:</u> int <b>UC_BIDI_PDF</b>
919 <a name="IDX388"></a>
921 <dd><p>The bidirectional category for “Pop Directional Format” characters.
925 <dt><u>Constant:</u> int <b>UC_BIDI_EN</b>
926 <a name="IDX389"></a>
928 <dd><p>The bidirectional category for “European Number” characters.
932 <dt><u>Constant:</u> int <b>UC_BIDI_ES</b>
933 <a name="IDX390"></a>
935 <dd><p>The bidirectional category for “European Number Separator” characters.
939 <dt><u>Constant:</u> int <b>UC_BIDI_ET</b>
940 <a name="IDX391"></a>
942 <dd><p>The bidirectional category for “European Number Terminator” characters.
946 <dt><u>Constant:</u> int <b>UC_BIDI_AN</b>
947 <a name="IDX392"></a>
949 <dd><p>The bidirectional category for “Arabic Number” characters.
953 <dt><u>Constant:</u> int <b>UC_BIDI_CS</b>
954 <a name="IDX393"></a>
956 <dd><p>The bidirectional category for “Common Number Separator” characters.
960 <dt><u>Constant:</u> int <b>UC_BIDI_NSM</b>
961 <a name="IDX394"></a>
963 <dd><p>The bidirectional category for “Non-Spacing Mark” characters.
967 <dt><u>Constant:</u> int <b>UC_BIDI_BN</b>
968 <a name="IDX395"></a>
970 <dd><p>The bidirectional category for “Boundary Neutral” characters.
974 <dt><u>Constant:</u> int <b>UC_BIDI_B</b>
975 <a name="IDX396"></a>
977 <dd><p>The bidirectional category for “Paragraph Separator” characters.
981 <dt><u>Constant:</u> int <b>UC_BIDI_S</b>
982 <a name="IDX397"></a>
984 <dd><p>The bidirectional category for “Segment Separator” characters.
988 <dt><u>Constant:</u> int <b>UC_BIDI_WS</b>
989 <a name="IDX398"></a>
991 <dd><p>The bidirectional category for “Whitespace” characters.
995 <dt><u>Constant:</u> int <b>UC_BIDI_ON</b>
996 <a name="IDX399"></a>
998 <dd><p>The bidirectional category for “Other Neutral” characters.
1001 <p>The following functions implement the association between a bidirectional
1002 category and its name.
1005 <dt><u>Function:</u> const char * <b>uc_bidi_category_name</b><i> (int <var>category</var>)</i>
1006 <a name="IDX400"></a>
1008 <dd><p>Returns the name of a bidirectional category.
1012 <dt><u>Function:</u> int <b>uc_bidi_category_byname</b><i> (const char *<var>category_name</var>)</i>
1013 <a name="IDX401"></a>
1015 <dd><p>Returns the bidirectional category given by name, e.g. <code>"LRE"</code>.
1018 <p>The following functions view bidirectional categories as sets of Unicode
1022 <dt><u>Function:</u> int <b>uc_bidi_category</b><i> (ucs4_t <var>uc</var>)</i>
1023 <a name="IDX402"></a>
1025 <dd><p>Returns the bidirectional category of a Unicode character.
1029 <dt><u>Function:</u> bool <b>uc_is_bidi_category</b><i> (ucs4_t <var>uc</var>, int <var>category</var>)</i>
1030 <a name="IDX403"></a>
1032 <dd><p>Tests whether a Unicode character belongs to a given bidirectional category.
1036 <a name="Decimal-digit-value"></a>
1037 <a name="SEC26"></a>
1038 <h2 class="section"> <a href="libunistring.html#TOC26">8.4 Decimal digit value</a> </h2>
1040 <p>Decimal digits (like the digits from ‘<samp>0</samp>’ to ‘<samp>9</samp>’) exist in many
1041 scripts. The following function converts a decimal digit character to its
1045 <dt><u>Function:</u> int <b>uc_decimal_value</b><i> (ucs4_t <var>uc</var>)</i>
1046 <a name="IDX404"></a>
1048 <dd><p>Returns the decimal digit value of a Unicode character.
1049 The return value is an integer in the range 0..9, or -1 for characters that
1050 do not represent a decimal digit.
1054 <a name="Digit-value"></a>
1055 <a name="SEC27"></a>
1056 <h2 class="section"> <a href="libunistring.html#TOC27">8.5 Digit value</a> </h2>
1058 <p>Digit characters are like decimal digit characters, possibly in special forms,
1059 like as superscript, subscript, or circled. The following function converts a
1060 digit character to its numerical value.
1063 <dt><u>Function:</u> int <b>uc_digit_value</b><i> (ucs4_t <var>uc</var>)</i>
1064 <a name="IDX405"></a>
1066 <dd><p>Returns the digit value of a Unicode character.
1067 The return value is an integer in the range 0..9, or -1 for characters that
1068 do not represent a digit.
1072 <a name="Numeric-value"></a>
1073 <a name="SEC28"></a>
1074 <h2 class="section"> <a href="libunistring.html#TOC28">8.6 Numeric value</a> </h2>
1076 <p>There are also characters that represent numbers without a digit system, like
1077 the Roman numerals, and fractional numbers, like 1/4 or 3/4.
1079 <p>The following type represents the numeric value of a Unicode character.
1081 <dt><u>Type:</u> <b>uc_fraction_t</b>
1082 <a name="IDX406"></a>
1084 <dd><p>This is a structure type with the following fields:
1085 </p><table><tr><td> </td><td><pre class="smallexample">int numerator;
1087 </pre></td></tr></table>
1088 <p>An integer <var>n</var> is represented by <code>numerator = <var>n</var></code>,
1089 <code>denominator = 1</code>.
1092 <p>The following function converts a number character to its numerical value.
1095 <dt><u>Function:</u> uc_fraction_t <b>uc_numeric_value</b><i> (ucs4_t <var>uc</var>)</i>
1096 <a name="IDX407"></a>
1098 <dd><p>Returns the numeric value of a Unicode character.
1099 The return value is a fraction, or the pseudo-fraction <code>{ 0, 0 }</code> for
1100 characters that do not represent a number.
1104 <a name="Mirrored-character"></a>
1105 <a name="SEC29"></a>
1106 <h2 class="section"> <a href="libunistring.html#TOC29">8.7 Mirrored character</a> </h2>
1108 <p>Character mirroring is used to associate the closing parenthesis character
1109 to the opening parenthesis character, the closing brace character with the
1110 opening brace character, and so on.
1112 <p>The following function looks up the mirrored character of a Unicode character.
1115 <dt><u>Function:</u> bool <b>uc_mirror_char</b><i> (ucs4_t <var>uc</var>, ucs4_t *<var>puc</var>)</i>
1116 <a name="IDX408"></a>
1118 <dd><p>Stores the mirrored character of a Unicode character <var>uc</var> in
1119 <code>*<var>puc</var></code> and returns <code>true</code>, if it exists. Otherwise it
1120 stores <var>uc</var> unmodified in <code>*<var>puc</var></code> and returns <code>false</code>.
1124 <a name="Properties"></a>
1125 <a name="SEC30"></a>
1126 <h2 class="section"> <a href="libunistring.html#TOC30">8.8 Properties</a> </h2>
1128 <p>This section defines boolean properties of Unicode characters. This
1129 means, a character either has the given property or does not have it.
1130 In other words, the property can be viewed as a subset of the set of
1133 <p>The GNU libunistring library provides two kinds of API for working with
1134 properties. The object oriented API uses a type <code>uc_property_t</code>
1135 to designate a property. In the function-based API, which is a bit more
1136 low level, a property is merely a function.
1140 <a name="Properties-as-objects"></a>
1141 <a name="SEC31"></a>
1142 <h3 class="subsection"> <a href="libunistring.html#TOC31">8.8.1 Properties as objects – the object oriented API</a> </h3>
1144 <p>The following type designates a property on Unicode characters.
1147 <dt><u>Type:</u> <b>uc_property_t</b>
1148 <a name="IDX409"></a>
1150 <dd><p>This data type denotes a boolean property on Unicode characters. It is an
1151 immediate type that can be copied by simple assignment, without involving
1152 memory allocation. It is not an array type.
1155 <p>Many Unicode properties are predefined.
1157 <p>The following are general properties.
1160 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_WHITE_SPACE</b>
1161 <a name="IDX410"></a>
1163 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_ALPHABETIC</b>
1164 <a name="IDX411"></a>
1166 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_OTHER_ALPHABETIC</b>
1167 <a name="IDX412"></a>
1169 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_NOT_A_CHARACTER</b>
1170 <a name="IDX413"></a>
1172 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT</b>
1173 <a name="IDX414"></a>
1175 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_OTHER_DEFAULT_IGNORABLE_CODE_POINT</b>
1176 <a name="IDX415"></a>
1178 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_DEPRECATED</b>
1179 <a name="IDX416"></a>
1181 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_LOGICAL_ORDER_EXCEPTION</b>
1182 <a name="IDX417"></a>
1184 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_VARIATION_SELECTOR</b>
1185 <a name="IDX418"></a>
1187 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_PRIVATE_USE</b>
1188 <a name="IDX419"></a>
1190 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_UNASSIGNED_CODE_VALUE</b>
1191 <a name="IDX420"></a>
1195 <p>The following properties are related to case folding.
1198 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_UPPERCASE</b>
1199 <a name="IDX421"></a>
1201 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_OTHER_UPPERCASE</b>
1202 <a name="IDX422"></a>
1204 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_LOWERCASE</b>
1205 <a name="IDX423"></a>
1207 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_OTHER_LOWERCASE</b>
1208 <a name="IDX424"></a>
1210 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_TITLECASE</b>
1211 <a name="IDX425"></a>
1213 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_SOFT_DOTTED</b>
1214 <a name="IDX426"></a>
1218 <p>The following properties are related to identifiers.
1221 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_ID_START</b>
1222 <a name="IDX427"></a>
1224 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_OTHER_ID_START</b>
1225 <a name="IDX428"></a>
1227 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_ID_CONTINUE</b>
1228 <a name="IDX429"></a>
1230 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_OTHER_ID_CONTINUE</b>
1231 <a name="IDX430"></a>
1233 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_XID_START</b>
1234 <a name="IDX431"></a>
1236 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_XID_CONTINUE</b>
1237 <a name="IDX432"></a>
1239 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_PATTERN_WHITE_SPACE</b>
1240 <a name="IDX433"></a>
1242 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_PATTERN_SYNTAX</b>
1243 <a name="IDX434"></a>
1247 <p>The following properties have an influence on shaping and rendering.
1250 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_JOIN_CONTROL</b>
1251 <a name="IDX435"></a>
1253 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_GRAPHEME_BASE</b>
1254 <a name="IDX436"></a>
1256 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_GRAPHEME_EXTEND</b>
1257 <a name="IDX437"></a>
1259 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_OTHER_GRAPHEME_EXTEND</b>
1260 <a name="IDX438"></a>
1262 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_GRAPHEME_LINK</b>
1263 <a name="IDX439"></a>
1267 <p>The following properties relate to bidirectional reordering.
1270 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_CONTROL</b>
1271 <a name="IDX440"></a>
1273 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_LEFT_TO_RIGHT</b>
1274 <a name="IDX441"></a>
1276 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_HEBREW_RIGHT_TO_LEFT</b>
1277 <a name="IDX442"></a>
1279 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_ARABIC_RIGHT_TO_LEFT</b>
1280 <a name="IDX443"></a>
1282 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_EUROPEAN_DIGIT</b>
1283 <a name="IDX444"></a>
1285 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_EUR_NUM_SEPARATOR</b>
1286 <a name="IDX445"></a>
1288 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_EUR_NUM_TERMINATOR</b>
1289 <a name="IDX446"></a>
1291 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_ARABIC_DIGIT</b>
1292 <a name="IDX447"></a>
1294 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_COMMON_SEPARATOR</b>
1295 <a name="IDX448"></a>
1297 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_BLOCK_SEPARATOR</b>
1298 <a name="IDX449"></a>
1300 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_SEGMENT_SEPARATOR</b>
1301 <a name="IDX450"></a>
1303 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_WHITESPACE</b>
1304 <a name="IDX451"></a>
1306 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_NON_SPACING_MARK</b>
1307 <a name="IDX452"></a>
1309 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_BOUNDARY_NEUTRAL</b>
1310 <a name="IDX453"></a>
1312 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_PDF</b>
1313 <a name="IDX454"></a>
1315 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_EMBEDDING_OR_OVERRIDE</b>
1316 <a name="IDX455"></a>
1318 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_BIDI_OTHER_NEUTRAL</b>
1319 <a name="IDX456"></a>
1323 <p>The following properties deal with number representations.
1326 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_HEX_DIGIT</b>
1327 <a name="IDX457"></a>
1329 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_ASCII_HEX_DIGIT</b>
1330 <a name="IDX458"></a>
1334 <p>The following properties deal with CJK.
1337 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_IDEOGRAPHIC</b>
1338 <a name="IDX459"></a>
1340 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_UNIFIED_IDEOGRAPH</b>
1341 <a name="IDX460"></a>
1343 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_RADICAL</b>
1344 <a name="IDX461"></a>
1346 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_IDS_BINARY_OPERATOR</b>
1347 <a name="IDX462"></a>
1349 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_IDS_TRINARY_OPERATOR</b>
1350 <a name="IDX463"></a>
1354 <p>Other miscellaneous properties are:
1357 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_ZERO_WIDTH</b>
1358 <a name="IDX464"></a>
1360 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_SPACE</b>
1361 <a name="IDX465"></a>
1363 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_NON_BREAK</b>
1364 <a name="IDX466"></a>
1366 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_ISO_CONTROL</b>
1367 <a name="IDX467"></a>
1369 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_FORMAT_CONTROL</b>
1370 <a name="IDX468"></a>
1372 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_DASH</b>
1373 <a name="IDX469"></a>
1375 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_HYPHEN</b>
1376 <a name="IDX470"></a>
1378 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_PUNCTUATION</b>
1379 <a name="IDX471"></a>
1381 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_LINE_SEPARATOR</b>
1382 <a name="IDX472"></a>
1384 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_PARAGRAPH_SEPARATOR</b>
1385 <a name="IDX473"></a>
1387 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_QUOTATION_MARK</b>
1388 <a name="IDX474"></a>
1390 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_SENTENCE_TERMINAL</b>
1391 <a name="IDX475"></a>
1393 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_TERMINAL_PUNCTUATION</b>
1394 <a name="IDX476"></a>
1396 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_CURRENCY_SYMBOL</b>
1397 <a name="IDX477"></a>
1399 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_MATH</b>
1400 <a name="IDX478"></a>
1402 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_OTHER_MATH</b>
1403 <a name="IDX479"></a>
1405 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_PAIRED_PUNCTUATION</b>
1406 <a name="IDX480"></a>
1408 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_LEFT_OF_PAIR</b>
1409 <a name="IDX481"></a>
1411 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_COMBINING</b>
1412 <a name="IDX482"></a>
1414 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_COMPOSITE</b>
1415 <a name="IDX483"></a>
1417 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_DECIMAL_DIGIT</b>
1418 <a name="IDX484"></a>
1420 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_NUMERIC</b>
1421 <a name="IDX485"></a>
1423 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_DIACRITIC</b>
1424 <a name="IDX486"></a>
1426 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_EXTENDER</b>
1427 <a name="IDX487"></a>
1429 <dt><u>Constant:</u> uc_property_t <b>UC_PROPERTY_IGNORABLE_CONTROL</b>
1430 <a name="IDX488"></a>
1434 <p>The following function looks up a property by its name.
1437 <dt><u>Function:</u> uc_property_t <b>uc_property_byname</b><i> (const char *<var>property_name</var>)</i>
1438 <a name="IDX489"></a>
1440 <dd><p>Returns the property given by name, e.g. <code>"White space"</code>. If a property
1441 with the given name exists, the result will satisfy the
1442 <code>uc_property_is_valid</code> predicate. Otherwise the result will not satisfy
1443 this predicate and must not be passed to functions that expect an
1444 <code>uc_property_t</code> argument.
1446 <p>This function references a big table of all predefined properties. Its use
1447 can significantly increase the size of your application.
1451 <dt><u>Function:</u> bool <b>uc_property_is_valid</b><i> (uc_property_t property)</i>
1452 <a name="IDX490"></a>
1454 <dd><p>Returns <code>true</code> when the given property is valid, or <code>false</code>
1458 <p>The following function views a property as a set of Unicode characters.
1461 <dt><u>Function:</u> bool <b>uc_is_property</b><i> (ucs4_t <var>uc</var>, uc_property_t <var>property</var>)</i>
1462 <a name="IDX491"></a>
1464 <dd><p>Tests whether the Unicode character <var>uc</var> has the given property.
1468 <a name="Properties-as-functions"></a>
1469 <a name="SEC32"></a>
1470 <h3 class="subsection"> <a href="libunistring.html#TOC32">8.8.2 Properties as functions – the functional API</a> </h3>
1472 <p>The following are general properties.
1475 <dt><u>Function:</u> bool <b>uc_is_property_white_space</b><i> (ucs4_t <var>uc</var>)</i>
1476 <a name="IDX492"></a>
1478 <dt><u>Function:</u> bool <b>uc_is_property_alphabetic</b><i> (ucs4_t <var>uc</var>)</i>
1479 <a name="IDX493"></a>
1481 <dt><u>Function:</u> bool <b>uc_is_property_other_alphabetic</b><i> (ucs4_t <var>uc</var>)</i>
1482 <a name="IDX494"></a>
1484 <dt><u>Function:</u> bool <b>uc_is_property_not_a_character</b><i> (ucs4_t <var>uc</var>)</i>
1485 <a name="IDX495"></a>
1487 <dt><u>Function:</u> bool <b>uc_is_property_default_ignorable_code_point</b><i> (ucs4_t <var>uc</var>)</i>
1488 <a name="IDX496"></a>
1490 <dt><u>Function:</u> bool <b>uc_is_property_other_default_ignorable_code_point</b><i> (ucs4_t <var>uc</var>)</i>
1491 <a name="IDX497"></a>
1493 <dt><u>Function:</u> bool <b>uc_is_property_deprecated</b><i> (ucs4_t <var>uc</var>)</i>
1494 <a name="IDX498"></a>
1496 <dt><u>Function:</u> bool <b>uc_is_property_logical_order_exception</b><i> (ucs4_t <var>uc</var>)</i>
1497 <a name="IDX499"></a>
1499 <dt><u>Function:</u> bool <b>uc_is_property_variation_selector</b><i> (ucs4_t <var>uc</var>)</i>
1500 <a name="IDX500"></a>
1502 <dt><u>Function:</u> bool <b>uc_is_property_private_use</b><i> (ucs4_t <var>uc</var>)</i>
1503 <a name="IDX501"></a>
1505 <dt><u>Function:</u> bool <b>uc_is_property_unassigned_code_value</b><i> (ucs4_t <var>uc</var>)</i>
1506 <a name="IDX502"></a>
1510 <p>The following properties are related to case folding.
1513 <dt><u>Function:</u> bool <b>uc_is_property_uppercase</b><i> (ucs4_t <var>uc</var>)</i>
1514 <a name="IDX503"></a>
1516 <dt><u>Function:</u> bool <b>uc_is_property_other_uppercase</b><i> (ucs4_t <var>uc</var>)</i>
1517 <a name="IDX504"></a>
1519 <dt><u>Function:</u> bool <b>uc_is_property_lowercase</b><i> (ucs4_t <var>uc</var>)</i>
1520 <a name="IDX505"></a>
1522 <dt><u>Function:</u> bool <b>uc_is_property_other_lowercase</b><i> (ucs4_t <var>uc</var>)</i>
1523 <a name="IDX506"></a>
1525 <dt><u>Function:</u> bool <b>uc_is_property_titlecase</b><i> (ucs4_t <var>uc</var>)</i>
1526 <a name="IDX507"></a>
1528 <dt><u>Function:</u> bool <b>uc_is_property_soft_dotted</b><i> (ucs4_t <var>uc</var>)</i>
1529 <a name="IDX508"></a>
1533 <p>The following properties are related to identifiers.
1536 <dt><u>Function:</u> bool <b>uc_is_property_id_start</b><i> (ucs4_t <var>uc</var>)</i>
1537 <a name="IDX509"></a>
1539 <dt><u>Function:</u> bool <b>uc_is_property_other_id_start</b><i> (ucs4_t <var>uc</var>)</i>
1540 <a name="IDX510"></a>
1542 <dt><u>Function:</u> bool <b>uc_is_property_id_continue</b><i> (ucs4_t <var>uc</var>)</i>
1543 <a name="IDX511"></a>
1545 <dt><u>Function:</u> bool <b>uc_is_property_other_id_continue</b><i> (ucs4_t <var>uc</var>)</i>
1546 <a name="IDX512"></a>
1548 <dt><u>Function:</u> bool <b>uc_is_property_xid_start</b><i> (ucs4_t <var>uc</var>)</i>
1549 <a name="IDX513"></a>
1551 <dt><u>Function:</u> bool <b>uc_is_property_xid_continue</b><i> (ucs4_t <var>uc</var>)</i>
1552 <a name="IDX514"></a>
1554 <dt><u>Function:</u> bool <b>uc_is_property_pattern_white_space</b><i> (ucs4_t <var>uc</var>)</i>
1555 <a name="IDX515"></a>
1557 <dt><u>Function:</u> bool <b>uc_is_property_pattern_syntax</b><i> (ucs4_t <var>uc</var>)</i>
1558 <a name="IDX516"></a>
1562 <p>The following properties have an influence on shaping and rendering.
1565 <dt><u>Function:</u> bool <b>uc_is_property_join_control</b><i> (ucs4_t <var>uc</var>)</i>
1566 <a name="IDX517"></a>
1568 <dt><u>Function:</u> bool <b>uc_is_property_grapheme_base</b><i> (ucs4_t <var>uc</var>)</i>
1569 <a name="IDX518"></a>
1571 <dt><u>Function:</u> bool <b>uc_is_property_grapheme_extend</b><i> (ucs4_t <var>uc</var>)</i>
1572 <a name="IDX519"></a>
1574 <dt><u>Function:</u> bool <b>uc_is_property_other_grapheme_extend</b><i> (ucs4_t <var>uc</var>)</i>
1575 <a name="IDX520"></a>
1577 <dt><u>Function:</u> bool <b>uc_is_property_grapheme_link</b><i> (ucs4_t <var>uc</var>)</i>
1578 <a name="IDX521"></a>
1582 <p>The following properties relate to bidirectional reordering.
1585 <dt><u>Function:</u> bool <b>uc_is_property_bidi_control</b><i> (ucs4_t <var>uc</var>)</i>
1586 <a name="IDX522"></a>
1588 <dt><u>Function:</u> bool <b>uc_is_property_bidi_left_to_right</b><i> (ucs4_t <var>uc</var>)</i>
1589 <a name="IDX523"></a>
1591 <dt><u>Function:</u> bool <b>uc_is_property_bidi_hebrew_right_to_left</b><i> (ucs4_t <var>uc</var>)</i>
1592 <a name="IDX524"></a>
1594 <dt><u>Function:</u> bool <b>uc_is_property_bidi_arabic_right_to_left</b><i> (ucs4_t <var>uc</var>)</i>
1595 <a name="IDX525"></a>
1597 <dt><u>Function:</u> bool <b>uc_is_property_bidi_european_digit</b><i> (ucs4_t <var>uc</var>)</i>
1598 <a name="IDX526"></a>
1600 <dt><u>Function:</u> bool <b>uc_is_property_bidi_eur_num_separator</b><i> (ucs4_t <var>uc</var>)</i>
1601 <a name="IDX527"></a>
1603 <dt><u>Function:</u> bool <b>uc_is_property_bidi_eur_num_terminator</b><i> (ucs4_t <var>uc</var>)</i>
1604 <a name="IDX528"></a>
1606 <dt><u>Function:</u> bool <b>uc_is_property_bidi_arabic_digit</b><i> (ucs4_t <var>uc</var>)</i>
1607 <a name="IDX529"></a>
1609 <dt><u>Function:</u> bool <b>uc_is_property_bidi_common_separator</b><i> (ucs4_t <var>uc</var>)</i>
1610 <a name="IDX530"></a>
1612 <dt><u>Function:</u> bool <b>uc_is_property_bidi_block_separator</b><i> (ucs4_t <var>uc</var>)</i>
1613 <a name="IDX531"></a>
1615 <dt><u>Function:</u> bool <b>uc_is_property_bidi_segment_separator</b><i> (ucs4_t <var>uc</var>)</i>
1616 <a name="IDX532"></a>
1618 <dt><u>Function:</u> bool <b>uc_is_property_bidi_whitespace</b><i> (ucs4_t <var>uc</var>)</i>
1619 <a name="IDX533"></a>
1621 <dt><u>Function:</u> bool <b>uc_is_property_bidi_non_spacing_mark</b><i> (ucs4_t <var>uc</var>)</i>
1622 <a name="IDX534"></a>
1624 <dt><u>Function:</u> bool <b>uc_is_property_bidi_boundary_neutral</b><i> (ucs4_t <var>uc</var>)</i>
1625 <a name="IDX535"></a>
1627 <dt><u>Function:</u> bool <b>uc_is_property_bidi_pdf</b><i> (ucs4_t <var>uc</var>)</i>
1628 <a name="IDX536"></a>
1630 <dt><u>Function:</u> bool <b>uc_is_property_bidi_embedding_or_override</b><i> (ucs4_t <var>uc</var>)</i>
1631 <a name="IDX537"></a>
1633 <dt><u>Function:</u> bool <b>uc_is_property_bidi_other_neutral</b><i> (ucs4_t <var>uc</var>)</i>
1634 <a name="IDX538"></a>
1638 <p>The following properties deal with number representations.
1641 <dt><u>Function:</u> bool <b>uc_is_property_hex_digit</b><i> (ucs4_t <var>uc</var>)</i>
1642 <a name="IDX539"></a>
1644 <dt><u>Function:</u> bool <b>uc_is_property_ascii_hex_digit</b><i> (ucs4_t <var>uc</var>)</i>
1645 <a name="IDX540"></a>
1649 <p>The following properties deal with CJK.
1652 <dt><u>Function:</u> bool <b>uc_is_property_ideographic</b><i> (ucs4_t <var>uc</var>)</i>
1653 <a name="IDX541"></a>
1655 <dt><u>Function:</u> bool <b>uc_is_property_unified_ideograph</b><i> (ucs4_t <var>uc</var>)</i>
1656 <a name="IDX542"></a>
1658 <dt><u>Function:</u> bool <b>uc_is_property_radical</b><i> (ucs4_t <var>uc</var>)</i>
1659 <a name="IDX543"></a>
1661 <dt><u>Function:</u> bool <b>uc_is_property_ids_binary_operator</b><i> (ucs4_t <var>uc</var>)</i>
1662 <a name="IDX544"></a>
1664 <dt><u>Function:</u> bool <b>uc_is_property_ids_trinary_operator</b><i> (ucs4_t <var>uc</var>)</i>
1665 <a name="IDX545"></a>
1669 <p>Other miscellaneous properties are:
1672 <dt><u>Function:</u> bool <b>uc_is_property_zero_width</b><i> (ucs4_t <var>uc</var>)</i>
1673 <a name="IDX546"></a>
1675 <dt><u>Function:</u> bool <b>uc_is_property_space</b><i> (ucs4_t <var>uc</var>)</i>
1676 <a name="IDX547"></a>
1678 <dt><u>Function:</u> bool <b>uc_is_property_non_break</b><i> (ucs4_t <var>uc</var>)</i>
1679 <a name="IDX548"></a>
1681 <dt><u>Function:</u> bool <b>uc_is_property_iso_control</b><i> (ucs4_t <var>uc</var>)</i>
1682 <a name="IDX549"></a>
1684 <dt><u>Function:</u> bool <b>uc_is_property_format_control</b><i> (ucs4_t <var>uc</var>)</i>
1685 <a name="IDX550"></a>
1687 <dt><u>Function:</u> bool <b>uc_is_property_dash</b><i> (ucs4_t <var>uc</var>)</i>
1688 <a name="IDX551"></a>
1690 <dt><u>Function:</u> bool <b>uc_is_property_hyphen</b><i> (ucs4_t <var>uc</var>)</i>
1691 <a name="IDX552"></a>
1693 <dt><u>Function:</u> bool <b>uc_is_property_punctuation</b><i> (ucs4_t <var>uc</var>)</i>
1694 <a name="IDX553"></a>
1696 <dt><u>Function:</u> bool <b>uc_is_property_line_separator</b><i> (ucs4_t <var>uc</var>)</i>
1697 <a name="IDX554"></a>
1699 <dt><u>Function:</u> bool <b>uc_is_property_paragraph_separator</b><i> (ucs4_t <var>uc</var>)</i>
1700 <a name="IDX555"></a>
1702 <dt><u>Function:</u> bool <b>uc_is_property_quotation_mark</b><i> (ucs4_t <var>uc</var>)</i>
1703 <a name="IDX556"></a>
1705 <dt><u>Function:</u> bool <b>uc_is_property_sentence_terminal</b><i> (ucs4_t <var>uc</var>)</i>
1706 <a name="IDX557"></a>
1708 <dt><u>Function:</u> bool <b>uc_is_property_terminal_punctuation</b><i> (ucs4_t <var>uc</var>)</i>
1709 <a name="IDX558"></a>
1711 <dt><u>Function:</u> bool <b>uc_is_property_currency_symbol</b><i> (ucs4_t <var>uc</var>)</i>
1712 <a name="IDX559"></a>
1714 <dt><u>Function:</u> bool <b>uc_is_property_math</b><i> (ucs4_t <var>uc</var>)</i>
1715 <a name="IDX560"></a>
1717 <dt><u>Function:</u> bool <b>uc_is_property_other_math</b><i> (ucs4_t <var>uc</var>)</i>
1718 <a name="IDX561"></a>
1720 <dt><u>Function:</u> bool <b>uc_is_property_paired_punctuation</b><i> (ucs4_t <var>uc</var>)</i>
1721 <a name="IDX562"></a>
1723 <dt><u>Function:</u> bool <b>uc_is_property_left_of_pair</b><i> (ucs4_t <var>uc</var>)</i>
1724 <a name="IDX563"></a>
1726 <dt><u>Function:</u> bool <b>uc_is_property_combining</b><i> (ucs4_t <var>uc</var>)</i>
1727 <a name="IDX564"></a>
1729 <dt><u>Function:</u> bool <b>uc_is_property_composite</b><i> (ucs4_t <var>uc</var>)</i>
1730 <a name="IDX565"></a>
1732 <dt><u>Function:</u> bool <b>uc_is_property_decimal_digit</b><i> (ucs4_t <var>uc</var>)</i>
1733 <a name="IDX566"></a>
1735 <dt><u>Function:</u> bool <b>uc_is_property_numeric</b><i> (ucs4_t <var>uc</var>)</i>
1736 <a name="IDX567"></a>
1738 <dt><u>Function:</u> bool <b>uc_is_property_diacritic</b><i> (ucs4_t <var>uc</var>)</i>
1739 <a name="IDX568"></a>
1741 <dt><u>Function:</u> bool <b>uc_is_property_extender</b><i> (ucs4_t <var>uc</var>)</i>
1742 <a name="IDX569"></a>
1744 <dt><u>Function:</u> bool <b>uc_is_property_ignorable_control</b><i> (ucs4_t <var>uc</var>)</i>
1745 <a name="IDX570"></a>
1750 <a name="Scripts"></a>
1751 <a name="SEC33"></a>
1752 <h2 class="section"> <a href="libunistring.html#TOC33">8.9 Scripts</a> </h2>
1754 <p>The Unicode characters are subdivided into scripts.
1756 <p>The following type is used to represent a script:
1759 <dt><u>Type:</u> <b>uc_script_t</b>
1760 <a name="IDX571"></a>
1762 <dd><p>This data type is a structure type that refers to statically allocated
1763 read-only data. It contains the following fields:
1764 </p><table><tr><td> </td><td><pre class="smallexample">const char *name;
1765 </pre></td></tr></table>
1767 <p>The <code>name</code> field contains the name of the script.
1770 <a name="IDX572"></a>
1771 <p>The following functions look up a script.
1774 <dt><u>Function:</u> const uc_script_t * <b>uc_script</b><i> (ucs4_t <var>uc</var>)</i>
1775 <a name="IDX573"></a>
1777 <dd><p>Returns the script of a Unicode character. Returns NULL if <var>uc</var> does not
1778 belong to any script.
1782 <dt><u>Function:</u> const uc_script_t * <b>uc_script_byname</b><i> (const char *<var>script_name</var>)</i>
1783 <a name="IDX574"></a>
1785 <dd><p>Returns the script given by its name, e.g. <code>"HAN"</code>. Returns NULL if a
1786 script with the given name does not exist.
1789 <p>The following function views a script as a set of Unicode characters.
1792 <dt><u>Function:</u> bool <b>uc_is_script</b><i> (ucs4_t <var>uc</var>, const uc_script_t *<var>script</var>)</i>
1793 <a name="IDX575"></a>
1795 <dd><p>Tests whether a Unicode character belongs to a given script.
1798 <p>The following gives a global picture of all scripts.
1801 <dt><u>Function:</u> void <b>uc_all_scripts</b><i> (const uc_script_t **<var>scripts</var>, size_t *<var>count</var>)</i>
1802 <a name="IDX576"></a>
1804 <dd><p>Get the list of all scripts. Stores a pointer to an array of all scripts in
1805 <code>*<var>scripts</var></code> and the length of this array in <code>*<var>count</var></code>.
1809 <a name="Blocks"></a>
1810 <a name="SEC34"></a>
1811 <h2 class="section"> <a href="libunistring.html#TOC34">8.10 Blocks</a> </h2>
1813 <p>The Unicode characters are subdivided into blocks. A block is an interval of
1814 Unicode code points.
1816 <p>The following type is used to represent a block.
1819 <dt><u>Type:</u> <b>uc_block_t</b>
1820 <a name="IDX577"></a>
1822 <dd><p>This data type is a structure type that refers to statically allocated data.
1823 It contains the following fields:
1824 </p><table><tr><td> </td><td><pre class="smallexample">ucs4_t start;
1827 </pre></td></tr></table>
1829 <p>The <code>start</code> field is the first Unicode code point in the block.
1831 <p>The <code>end</code> field is the last Unicode code point in the block.
1833 <p>The <code>name</code> field is the name of the block.
1836 <a name="IDX578"></a>
1837 <p>The following function looks up a block.
1840 <dt><u>Function:</u> const uc_block_t * <b>uc_block</b><i> (ucs4_t <var>uc</var>)</i>
1841 <a name="IDX579"></a>
1843 <dd><p>Returns the block a character belongs to.
1846 <p>The following function views a block as a set of Unicode characters.
1849 <dt><u>Function:</u> bool <b>uc_is_block</b><i> (ucs4_t <var>uc</var>, const uc_block_t *<var>block</var>)</i>
1850 <a name="IDX580"></a>
1852 <dd><p>Tests whether a Unicode character belongs to a given block.
1855 <p>The following gives a global picture of all block.
1858 <dt><u>Function:</u> void <b>uc_all_blocks</b><i> (const uc_block_t **<var>blocks</var>, size_t *<var>count</var>)</i>
1859 <a name="IDX581"></a>
1861 <dd><p>Get the list of all blocks. Stores a pointer to an array of all blocks in
1862 <code>*<var>blocks</var></code> and the length of this array in <code>*<var>count</var></code>.
1866 <a name="ISO-C-and-Java-syntax"></a>
1867 <a name="SEC35"></a>
1868 <h2 class="section"> <a href="libunistring.html#TOC35">8.11 ISO C and Java syntax</a> </h2>
1870 <p>The following properties are taken from language standards. The supported
1871 language standards are ISO C 99 and Java.
1874 <dt><u>Function:</u> bool <b>uc_is_c_whitespace</b><i> (ucs4_t <var>uc</var>)</i>
1875 <a name="IDX582"></a>
1877 <dd><p>Tests whether a Unicode character is considered whitespace in ISO C 99.
1881 <dt><u>Function:</u> bool <b>uc_is_java_whitespace</b><i> (ucs4_t <var>uc</var>)</i>
1882 <a name="IDX583"></a>
1884 <dd><p>Tests whether a Unicode character is considered whitespace in Java.
1887 <p>The following enumerated values are the possible return values of the functions
1888 <code>uc_c_ident_category</code> and <code>uc_java_ident_category</code>.
1891 <dt><u>Constant:</u> int <b>UC_IDENTIFIER_START</b>
1892 <a name="IDX584"></a>
1894 <dd><p>This return value means that the given character is valid as first or
1895 subsequent character in an identifier.
1899 <dt><u>Constant:</u> int <b>UC_IDENTIFIER_VALID</b>
1900 <a name="IDX585"></a>
1902 <dd><p>This return value means that the given character is valid as subsequent
1907 <dt><u>Constant:</u> int <b>UC_IDENTIFIER_INVALID</b>
1908 <a name="IDX586"></a>
1910 <dd><p>This return value means that the given character is not valid in an identifier.
1914 <dt><u>Constant:</u> int <b>UC_IDENTIFIER_IGNORABLE</b>
1915 <a name="IDX587"></a>
1917 <dd><p>This return value (only for Java) means that the given character is ignorable.
1920 <p>The following function determine whether a given character can be a constituent
1921 of an identifier in the given programming language.
1923 <a name="IDX588"></a>
1925 <dt><u>Function:</u> int <b>uc_c_ident_category</b><i> (ucs4_t <var>uc</var>)</i>
1926 <a name="IDX589"></a>
1928 <dd><p>Returns the categorization of a Unicode character with respect to the ISO C 99
1932 <a name="IDX590"></a>
1934 <dt><u>Function:</u> int <b>uc_java_ident_category</b><i> (ucs4_t <var>uc</var>)</i>
1935 <a name="IDX591"></a>
1937 <dd><p>Returns the categorization of a Unicode character with respect to the Java
1942 <a name="Classifications-like-in-ISO-C"></a>
1943 <a name="SEC36"></a>
1944 <h2 class="section"> <a href="libunistring.html#TOC36">8.12 Classifications like in ISO C</a> </h2>
1946 <p>The following character classifications mimic those declared in the ISO C
1947 header files <code><ctype.h></code> and <code><wctype.h></code>. These functions are
1948 deprecated, because this set of functions was designed with ASCII in mind and
1949 cannot reflect the more diverse reality of the Unicode character set. But
1950 they can be a quick-and-dirty porting aid when migrating from <code>wchar_t</code>
1951 APIs to Unicode strings.
1954 <dt><u>Function:</u> bool <b>uc_is_alnum</b><i> (ucs4_t <var>uc</var>)</i>
1955 <a name="IDX592"></a>
1957 <dd><p>Tests for any character for which <code>uc_is_alpha</code> or <code>uc_is_digit</code> is
1962 <dt><u>Function:</u> bool <b>uc_is_alpha</b><i> (ucs4_t <var>uc</var>)</i>
1963 <a name="IDX593"></a>
1965 <dd><p>Tests for any character for which <code>uc_is_upper</code> or <code>uc_is_lower</code> is
1966 true, or any character that is one of a locale-specific set of characters for
1967 which none of <code>uc_is_cntrl</code>, <code>uc_is_digit</code>, <code>uc_is_punct</code>, or
1968 <code>uc_is_space</code> is true.
1972 <dt><u>Function:</u> bool <b>uc_is_cntrl</b><i> (ucs4_t <var>uc</var>)</i>
1973 <a name="IDX594"></a>
1975 <dd><p>Tests for any control character.
1979 <dt><u>Function:</u> bool <b>uc_is_digit</b><i> (ucs4_t <var>uc</var>)</i>
1980 <a name="IDX595"></a>
1982 <dd><p>Tests for any character that corresponds to a decimal-digit character.
1986 <dt><u>Function:</u> bool <b>uc_is_graph</b><i> (ucs4_t <var>uc</var>)</i>
1987 <a name="IDX596"></a>
1989 <dd><p>Tests for any character for which <code>uc_is_print</code> is true and
1990 <code>uc_is_space</code> is false.
1994 <dt><u>Function:</u> bool <b>uc_is_lower</b><i> (ucs4_t <var>uc</var>)</i>
1995 <a name="IDX597"></a>
1997 <dd><p>Tests for any character that corresponds to a lowercase letter or is one
1998 of a locale-specific set of characters for which none of <code>uc_is_cntrl</code>,
1999 <code>uc_is_digit</code>, <code>uc_is_punct</code>, or <code>uc_is_space</code> is true.
2003 <dt><u>Function:</u> bool <b>uc_is_print</b><i> (ucs4_t <var>uc</var>)</i>
2004 <a name="IDX598"></a>
2006 <dd><p>Tests for any printing character.
2010 <dt><u>Function:</u> bool <b>uc_is_punct</b><i> (ucs4_t <var>uc</var>)</i>
2011 <a name="IDX599"></a>
2013 <dd><p>Tests for any printing character that is one of a locale-specific set of
2014 characters for which neither <code>uc_is_space</code> nor <code>uc_is_alnum</code> is true.
2018 <dt><u>Function:</u> bool <b>uc_is_space</b><i> (ucs4_t <var>uc</var>)</i>
2019 <a name="IDX600"></a>
2021 <dd><p>Test for any character that corresponds to a locale-specific set of characters
2022 for which none of <code>uc_is_alnum</code>, <code>uc_is_graph</code>, or <code>uc_is_punct</code>
2027 <dt><u>Function:</u> bool <b>uc_is_upper</b><i> (ucs4_t <var>uc</var>)</i>
2028 <a name="IDX601"></a>
2030 <dd><p>Tests for any character that corresponds to an uppercase letter or is one
2031 of a locale-specific set of characters for which none of <code>uc_is_cntrl</code>,
2032 <code>uc_is_digit</code>, <code>uc_is_punct</code>, or <code>uc_is_space</code> is true.
2036 <dt><u>Function:</u> bool <b>uc_is_xdigit</b><i> (ucs4_t <var>uc</var>)</i>
2037 <a name="IDX602"></a>
2039 <dd><p>Tests for any character that corresponds to a hexadecimal-digit character.
2043 <dt><u>Function:</u> bool <b>uc_is_blank</b><i> (ucs4_t <var>uc</var>)</i>
2044 <a name="IDX603"></a>
2046 <dd><p>Tests for any character that corresponds to a standard blank character or
2047 a locale-specific set of characters for which <code>uc_is_alnum</code> is false.
2050 <table cellpadding="1" cellspacing="1" border="0">
2051 <tr><td valign="middle" align="left">[<a href="#SEC20" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2052 <td valign="middle" align="left">[<a href="libunistring_9.html#SEC37" title="Next chapter"> >> </a>]</td>
2053 <td valign="middle" align="left"> </td>
2054 <td valign="middle" align="left"> </td>
2055 <td valign="middle" align="left"> </td>
2056 <td valign="middle" align="left"> </td>
2057 <td valign="middle" align="left"> </td>
2058 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2059 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
2060 <td valign="middle" align="left">[<a href="libunistring_18.html#SEC71" title="Index">Index</a>]</td>
2061 <td valign="middle" align="left">[<a href="libunistring_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
2065 This document was generated by <em>Bruno Haible</em> on <em>March, 30 2010</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.78a</em></a>.