1 /* guniprop.c - Unicode character properties.
3 * Copyright (C) 1999 Tom Tromey
4 * Copyright (C) 2000 Red Hat, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
29 #include "gunichartables.h"
30 #include "gmirroringtable.h"
31 #include "gunicodeprivate.h"
34 #define ATTR_TABLE(Page) (((Page) <= G_UNICODE_LAST_PAGE_PART1) \
35 ? attr_table_part1[Page] \
36 : attr_table_part2[(Page) - 0xe00])
38 #define ATTTABLE(Page, Char) \
39 ((ATTR_TABLE(Page) == G_UNICODE_MAX_TABLE_INDEX) ? 0 : (attr_data[ATTR_TABLE(Page)][Char]))
41 #define TTYPE_PART1(Page, Char) \
42 ((type_table_part1[Page] >= G_UNICODE_MAX_TABLE_INDEX) \
43 ? (type_table_part1[Page] - G_UNICODE_MAX_TABLE_INDEX) \
44 : (type_data[type_table_part1[Page]][Char]))
46 #define TTYPE_PART2(Page, Char) \
47 ((type_table_part2[Page] >= G_UNICODE_MAX_TABLE_INDEX) \
48 ? (type_table_part2[Page] - G_UNICODE_MAX_TABLE_INDEX) \
49 : (type_data[type_table_part2[Page]][Char]))
52 (((Char) <= G_UNICODE_LAST_CHAR_PART1) \
53 ? TTYPE_PART1 ((Char) >> 8, (Char) & 0xff) \
54 : (((Char) >= 0xe0000 && (Char) <= G_UNICODE_LAST_CHAR) \
55 ? TTYPE_PART2 (((Char) - 0xe0000) >> 8, (Char) & 0xff) \
56 : G_UNICODE_UNASSIGNED))
59 #define ISDIGIT(Type) ((Type) == G_UNICODE_DECIMAL_NUMBER \
60 || (Type) == G_UNICODE_LETTER_NUMBER \
61 || (Type) == G_UNICODE_OTHER_NUMBER)
63 #define ISALPHA(Type) ((Type) == G_UNICODE_LOWERCASE_LETTER \
64 || (Type) == G_UNICODE_UPPERCASE_LETTER \
65 || (Type) == G_UNICODE_TITLECASE_LETTER \
66 || (Type) == G_UNICODE_MODIFIER_LETTER \
67 || (Type) == G_UNICODE_OTHER_LETTER)
69 #define ISMARK(Type) ((Type) == G_UNICODE_NON_SPACING_MARK || \
70 (Type) == G_UNICODE_COMBINING_MARK || \
71 (Type) == G_UNICODE_ENCLOSING_MARK)
76 * @c: a Unicode character
78 * Determines whether a character is alphanumeric.
79 * Given some UTF-8 text, obtain a character value
80 * with g_utf8_get_char().
82 * Return value: %TRUE if @c is an alphanumeric character
85 g_unichar_isalnum (gunichar c)
88 return ISDIGIT (t) || ISALPHA (t);
93 * @c: a Unicode character
95 * Determines whether a character is alphabetic (i.e. a letter).
96 * Given some UTF-8 text, obtain a character value with
99 * Return value: %TRUE if @c is an alphabetic character
102 g_unichar_isalpha (gunichar c)
111 * @c: a Unicode character
113 * Determines whether a character is a control character.
114 * Given some UTF-8 text, obtain a character value with
117 * Return value: %TRUE if @c is a control character
120 g_unichar_iscntrl (gunichar c)
122 return TYPE (c) == G_UNICODE_CONTROL;
127 * @c: a Unicode character
129 * Determines whether a character is numeric (i.e. a digit). This
130 * covers ASCII 0-9 and also digits in other languages/scripts. Given
131 * some UTF-8 text, obtain a character value with g_utf8_get_char().
133 * Return value: %TRUE if @c is a digit
136 g_unichar_isdigit (gunichar c)
138 return TYPE (c) == G_UNICODE_DECIMAL_NUMBER;
144 * @c: a Unicode character
146 * Determines whether a character is printable and not a space
147 * (returns %FALSE for control characters, format characters, and
148 * spaces). g_unichar_isprint() is similar, but returns %TRUE for
149 * spaces. Given some UTF-8 text, obtain a character value with
152 * Return value: %TRUE if @c is printable unless it's a space
155 g_unichar_isgraph (gunichar c)
158 return (t != G_UNICODE_CONTROL
159 && t != G_UNICODE_FORMAT
160 && t != G_UNICODE_UNASSIGNED
161 && t != G_UNICODE_PRIVATE_USE
162 && t != G_UNICODE_SURROGATE
163 && t != G_UNICODE_SPACE_SEPARATOR);
168 * @c: a Unicode character
170 * Determines whether a character is a lowercase letter.
171 * Given some UTF-8 text, obtain a character value with
174 * Return value: %TRUE if @c is a lowercase letter
177 g_unichar_islower (gunichar c)
179 return TYPE (c) == G_UNICODE_LOWERCASE_LETTER;
185 * @c: a Unicode character
187 * Determines whether a character is printable.
188 * Unlike g_unichar_isgraph(), returns %TRUE for spaces.
189 * Given some UTF-8 text, obtain a character value with
192 * Return value: %TRUE if @c is printable
195 g_unichar_isprint (gunichar c)
198 return (t != G_UNICODE_CONTROL
199 && t != G_UNICODE_FORMAT
200 && t != G_UNICODE_UNASSIGNED
201 && t != G_UNICODE_PRIVATE_USE
202 && t != G_UNICODE_SURROGATE);
207 * @c: a Unicode character
209 * Determines whether a character is punctuation or a symbol.
210 * Given some UTF-8 text, obtain a character value with
213 * Return value: %TRUE if @c is a punctuation or symbol character
216 g_unichar_ispunct (gunichar c)
219 return (t == G_UNICODE_CONNECT_PUNCTUATION || t == G_UNICODE_DASH_PUNCTUATION
220 || t == G_UNICODE_CLOSE_PUNCTUATION || t == G_UNICODE_FINAL_PUNCTUATION
221 || t == G_UNICODE_INITIAL_PUNCTUATION || t == G_UNICODE_OTHER_PUNCTUATION
222 || t == G_UNICODE_OPEN_PUNCTUATION || t == G_UNICODE_CURRENCY_SYMBOL
223 || t == G_UNICODE_MODIFIER_SYMBOL || t == G_UNICODE_MATH_SYMBOL
224 || t == G_UNICODE_OTHER_SYMBOL);
229 * @c: a Unicode character
231 * Determines whether a character is a space, tab, or line separator
232 * (newline, carriage return, etc.). Given some UTF-8 text, obtain a
233 * character value with g_utf8_get_char().
235 * (Note: don't use this to do word breaking; you have to use
236 * Pango or equivalent to get word breaking right, the algorithm
237 * is fairly complex.)
239 * Return value: %TRUE if @c is a punctuation character
242 g_unichar_isspace (gunichar c)
246 /* special-case these since Unicode thinks they are not spaces */
257 return (t == G_UNICODE_SPACE_SEPARATOR || t == G_UNICODE_LINE_SEPARATOR
258 || t == G_UNICODE_PARAGRAPH_SEPARATOR);
266 * @c: a Unicode character
268 * Determines if a character is uppercase.
270 * Return value: %TRUE if @c is an uppercase character
273 g_unichar_isupper (gunichar c)
275 return TYPE (c) == G_UNICODE_UPPERCASE_LETTER;
280 * @c: a Unicode character
282 * Determines if a character is titlecase. Some characters in
283 * Unicode which are composites, such as the DZ digraph
284 * have three case variants instead of just two. The titlecase
285 * form is used at the beginning of a word where only the
286 * first letter is capitalized. The titlecase form of the DZ
287 * digraph is U+01F2 LATIN CAPITAL LETTTER D WITH SMALL LETTER Z.
289 * Return value: %TRUE if the character is titlecase
292 g_unichar_istitle (gunichar c)
295 for (i = 0; i < G_N_ELEMENTS (title_table); ++i)
296 if (title_table[i][0] == c)
302 * g_unichar_isxdigit:
303 * @c: a Unicode character.
305 * Determines if a character is a hexidecimal digit.
307 * Return value: %TRUE if the character is a hexadecimal digit
310 g_unichar_isxdigit (gunichar c)
313 return ((c >= 'a' && c <= 'f')
314 || (c >= 'A' && c <= 'F')
319 * g_unichar_isdefined:
320 * @c: a Unicode character
322 * Determines if a given character is assigned in the Unicode
325 * Return value: %TRUE if the character has an assigned value
328 g_unichar_isdefined (gunichar c)
331 return t != G_UNICODE_UNASSIGNED;
336 * @c: a Unicode character
338 * Determines if a character is typically rendered in a double-width
341 * Return value: %TRUE if the character is wide
343 /* This function stolen from Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk>. */
345 g_unichar_iswide (gunichar c)
350 return (c <= 0x115f /* Hangul Jamo init. consonants */
351 || c == 0x2329 || c == 0x232a /* angle brackets */
352 || (c >= 0x2e80 && c <= 0xa4cf && (c < 0x302a || c > 0x302f)
353 && c != 0x303f && c != 0x3099 && c!= 0x309a) /* CJK ... Yi */
354 || (c >= 0xac00 && c <= 0xd7a3) /* Hangul Syllables */
355 || (c >= 0xf900 && c <= 0xfaff) /* CJK Compatibility Ideographs */
356 || (c >= 0xfe30 && c <= 0xfe6f) /* CJK Compatibility Forms */
357 || (c >= 0xff00 && c <= 0xff60) /* Fullwidth Forms */
358 || (c >= 0xffe0 && c <= 0xffe6) /* Fullwidth Forms */
359 || (c >= 0x20000 && c <= 0x2fffd) /* CJK extra stuff */
360 || (c >= 0x30000 && c <= 0x3fffd));
365 * @c: a Unicode character
367 * Converts a character to uppercase.
369 * Return value: the result of converting @c to uppercase.
370 * If @c is not an lowercase or titlecase character,
371 * or has no upper case equivalent @c is returned unchanged.
374 g_unichar_toupper (gunichar c)
377 if (t == G_UNICODE_LOWERCASE_LETTER)
379 gunichar val = ATTTABLE (c >> 8, c & 0xff);
380 if (val >= 0x1000000)
382 const gchar *p = special_case_table + val - 0x1000000;
383 return g_utf8_get_char (p);
386 return val ? val : c;
388 else if (t == G_UNICODE_TITLECASE_LETTER)
391 for (i = 0; i < G_N_ELEMENTS (title_table); ++i)
393 if (title_table[i][0] == c)
394 return title_table[i][1];
402 * @c: a Unicode character.
404 * Converts a character to lower case.
406 * Return value: the result of converting @c to lower case.
407 * If @c is not an upperlower or titlecase character,
408 * or has no lowercase equivalent @c is returned unchanged.
411 g_unichar_tolower (gunichar c)
414 if (t == G_UNICODE_UPPERCASE_LETTER)
416 gunichar val = ATTTABLE (c >> 8, c & 0xff);
417 if (val >= 0x1000000)
419 const gchar *p = special_case_table + val - 0x1000000;
420 return g_utf8_get_char (p);
423 return val ? val : c;
425 else if (t == G_UNICODE_TITLECASE_LETTER)
428 for (i = 0; i < G_N_ELEMENTS (title_table); ++i)
430 if (title_table[i][0] == c)
431 return title_table[i][2];
439 * @c: a Unicode character
441 * Converts a character to the titlecase.
443 * Return value: the result of converting @c to titlecase.
444 * If @c is not an uppercase or lowercase character,
445 * @c is returned unchanged.
448 g_unichar_totitle (gunichar c)
451 for (i = 0; i < G_N_ELEMENTS (title_table); ++i)
453 if (title_table[i][0] == c || title_table[i][1] == c
454 || title_table[i][2] == c)
455 return title_table[i][0];
457 return (TYPE (c) == G_UNICODE_LOWERCASE_LETTER
458 ? ATTTABLE (c >> 8, c & 0xff)
463 * g_unichar_digit_value:
464 * @c: a Unicode character
466 * Determines the numeric value of a character as a decimal
469 * Return value: If @c is a decimal digit (according to
470 * g_unichar_isdigit()), its numeric value. Otherwise, -1.
473 g_unichar_digit_value (gunichar c)
475 if (TYPE (c) == G_UNICODE_DECIMAL_NUMBER)
476 return ATTTABLE (c >> 8, c & 0xff);
481 * g_unichar_xdigit_value:
482 * @c: a Unicode character
484 * Determines the numeric value of a character as a hexidecimal
487 * Return value: If @c is a hex digit (according to
488 * g_unichar_isxdigit()), its numeric value. Otherwise, -1.
491 g_unichar_xdigit_value (gunichar c)
493 if (c >= 'A' && c <= 'F')
495 if (c >= 'a' && c <= 'f')
497 if (TYPE (c) == G_UNICODE_DECIMAL_NUMBER)
498 return ATTTABLE (c >> 8, c & 0xff);
504 * @c: a Unicode character
506 * Classifies a Unicode character by type.
508 * Return value: the type of the character.
511 g_unichar_type (gunichar c)
517 * Case mapping functions
527 get_locale_type (void)
530 char *tem = g_win32_getlocale ();
537 const char *locale = setlocale (LC_CTYPE, NULL);
543 if (locale[1] == 'z')
544 return LOCALE_TURKIC;
547 if (locale[1] == 't')
548 return LOCALE_LITHUANIAN;
551 if (locale[1] == 'r')
552 return LOCALE_TURKIC;
556 return LOCALE_NORMAL;
560 output_marks (const char **p_inout,
564 const char *p = *p_inout;
569 gunichar c = g_utf8_get_char (p);
574 if (!remove_dot || c != 0x307 /* COMBINING DOT ABOVE */)
575 len += g_unichar_to_utf8 (c, out_buffer ? out_buffer + len : NULL);
576 p = g_utf8_next_char (p);
587 output_special_case (gchar *out_buffer,
592 const gchar *p = special_case_table + offset;
595 if (type != G_UNICODE_TITLECASE_LETTER)
596 p = g_utf8_next_char (p);
603 memcpy (out_buffer, p, len);
609 real_toupper (const gchar *str,
612 LocaleType locale_type)
614 const gchar *p = str;
615 const char *last = NULL;
617 gboolean last_was_i = FALSE;
619 while ((max_len < 0 || p < str + max_len) && *p)
621 gunichar c = g_utf8_get_char (p);
626 p = g_utf8_next_char (p);
628 if (locale_type == LOCALE_LITHUANIAN)
636 /* Nasty, need to remove any dot above. Though
637 * I think only E WITH DOT ABOVE occurs in practice
638 * which could simplify this considerably.
643 decomp = g_unicode_canonical_decomposition (c, &decomp_len);
644 for (i=0; i < decomp_len; i++)
646 if (decomp[i] != 0x307 /* COMBINING DOT ABOVE */)
647 len += g_unichar_to_utf8 (g_unichar_toupper (decomp[i]), out_buffer ? out_buffer + len : NULL);
651 len += output_marks (&p, out_buffer ? out_buffer + len : NULL, TRUE);
661 if (locale_type == LOCALE_TURKIC && c == 'i')
663 /* i => LATIN CAPITAL LETTER I WITH DOT ABOVE */
664 len += g_unichar_to_utf8 (0x130, out_buffer ? out_buffer + len : NULL);
666 else if (c == 0x0345) /* COMBINING GREEK YPOGEGRAMMENI */
668 /* Nasty, need to move it after other combining marks .. this would go away if
669 * we normalized first.
671 len += output_marks (&p, out_buffer ? out_buffer + len : NULL, FALSE);
673 /* And output as GREEK CAPITAL LETTER IOTA */
674 len += g_unichar_to_utf8 (0x399, out_buffer ? out_buffer + len : NULL);
676 else if (t == G_UNICODE_LOWERCASE_LETTER || t == G_UNICODE_TITLECASE_LETTER)
678 val = ATTTABLE (c >> 8, c & 0xff);
680 if (val >= 0x1000000)
682 len += output_special_case (out_buffer ? out_buffer + len : NULL, val - 0x1000000, t,
683 t == G_UNICODE_LOWERCASE_LETTER ? 0 : 1);
687 if (t == G_UNICODE_TITLECASE_LETTER)
690 for (i = 0; i < G_N_ELEMENTS (title_table); ++i)
692 if (title_table[i][0] == c)
693 val = title_table[i][1];
697 len += g_unichar_to_utf8 (val, out_buffer ? out_buffer + len : NULL);
702 gsize char_len = g_utf8_skip[*(guchar *)last];
705 memcpy (out_buffer + len, last, char_len);
717 * @str: a UTF-8 encoded string
718 * @len: length of @str, in bytes, or -1 if @str is nul-terminated.
720 * Converts all Unicode characters in the string that have a case
721 * to uppercase. The exact manner that this is done depends
722 * on the current locale, and may result in the number of
723 * characters in the string increasing. (For instance, the
724 * German ess-zet will be changed to SS.)
726 * Return value: a newly allocated string, with all characters
727 * converted to uppercase.
730 g_utf8_strup (const gchar *str,
734 LocaleType locale_type;
737 g_return_val_if_fail (str != NULL, NULL);
739 locale_type = get_locale_type ();
742 * We use a two pass approach to keep memory management simple
744 result_len = real_toupper (str, len, NULL, locale_type);
745 result = g_malloc (result_len + 1);
746 real_toupper (str, len, result, locale_type);
747 result[result_len] = '\0';
752 /* traverses the string checking for characters with combining class == 230
753 * until a base character is found */
755 has_more_above (const gchar *str)
757 const gchar *p = str;
758 gint combining_class;
762 combining_class = _g_unichar_combining_class (g_utf8_get_char (p));
763 if (combining_class == 230)
765 else if (combining_class == 0)
768 p = g_utf8_next_char (p);
775 real_tolower (const gchar *str,
778 LocaleType locale_type)
780 const gchar *p = str;
781 const char *last = NULL;
784 while ((max_len < 0 || p < str + max_len) && *p)
786 gunichar c = g_utf8_get_char (p);
791 p = g_utf8_next_char (p);
793 if (locale_type == LOCALE_TURKIC && c == 'I')
795 if (g_utf8_get_char (p) == 0x0307)
797 /* I + COMBINING DOT ABOVE => i (U+0069) */
798 len += g_unichar_to_utf8 (0x0069, out_buffer ? out_buffer + len : NULL);
799 p = g_utf8_next_char (p);
803 /* I => LATIN SMALL LETTER DOTLESS I */
804 len += g_unichar_to_utf8 (0x131, out_buffer ? out_buffer + len : NULL);
807 /* Introduce an explicit dot above when lowercasing capital I's and J's
808 * whenever there are more accents above. [SpecialCasing.txt] */
809 else if (locale_type == LOCALE_LITHUANIAN &&
810 (c == 0x00cc || c == 0x00cd || c == 0x0128))
812 len += g_unichar_to_utf8 (0x0069, out_buffer ? out_buffer + len : NULL);
813 len += g_unichar_to_utf8 (0x0307, out_buffer ? out_buffer + len : NULL);
818 len += g_unichar_to_utf8 (0x0300, out_buffer ? out_buffer + len : NULL);
821 len += g_unichar_to_utf8 (0x0301, out_buffer ? out_buffer + len : NULL);
824 len += g_unichar_to_utf8 (0x0303, out_buffer ? out_buffer + len : NULL);
828 else if (locale_type == LOCALE_LITHUANIAN &&
829 (c == 'I' || c == 'J' || c == 0x012e) &&
832 len += g_unichar_to_utf8 (g_unichar_tolower (c), out_buffer ? out_buffer + len : NULL);
833 len += g_unichar_to_utf8 (0x0307, out_buffer ? out_buffer + len : NULL);
835 else if (c == 0x03A3) /* GREEK CAPITAL LETTER SIGMA */
837 if ((max_len < 0 || p < str + max_len) && *p)
839 gunichar next_c = g_utf8_get_char (p);
840 int next_type = TYPE(next_c);
842 /* SIGMA mapps differently depending on whether it is
843 * final or not. The following simplified test would
844 * fail in the case of combining marks following the
845 * sigma, but I don't think that occurs in real text.
846 * The test here matches that in ICU.
848 if (ISALPHA(next_type)) /* Lu,Ll,Lt,Lm,Lo */
849 val = 0x3c3; /* GREEK SMALL SIGMA */
851 val = 0x3c2; /* GREEK SMALL FINAL SIGMA */
854 val = 0x3c2; /* GREEK SMALL FINAL SIGMA */
856 len += g_unichar_to_utf8 (val, out_buffer ? out_buffer + len : NULL);
858 else if (t == G_UNICODE_UPPERCASE_LETTER || t == G_UNICODE_TITLECASE_LETTER)
860 val = ATTTABLE (c >> 8, c & 0xff);
862 if (val >= 0x1000000)
864 len += output_special_case (out_buffer ? out_buffer + len : NULL, val - 0x1000000, t, 0);
868 if (t == G_UNICODE_TITLECASE_LETTER)
871 for (i = 0; i < G_N_ELEMENTS (title_table); ++i)
873 if (title_table[i][0] == c)
874 val = title_table[i][2];
878 len += g_unichar_to_utf8 (val, out_buffer ? out_buffer + len : NULL);
883 gsize char_len = g_utf8_skip[*(guchar *)last];
886 memcpy (out_buffer + len, last, char_len);
898 * @str: a UTF-8 encoded string
899 * @len: length of @str, in bytes, or -1 if @str is nul-terminated.
901 * Converts all Unicode characters in the string that have a case
902 * to lowercase. The exact manner that this is done depends
903 * on the current locale, and may result in the number of
904 * characters in the string changing.
906 * Return value: a newly allocated string, with all characters
907 * converted to lowercase.
910 g_utf8_strdown (const gchar *str,
914 LocaleType locale_type;
917 g_return_val_if_fail (str != NULL, NULL);
919 locale_type = get_locale_type ();
922 * We use a two pass approach to keep memory management simple
924 result_len = real_tolower (str, len, NULL, locale_type);
925 result = g_malloc (result_len + 1);
926 real_tolower (str, len, result, locale_type);
927 result[result_len] = '\0';
934 * @str: a UTF-8 encoded string
935 * @len: length of @str, in bytes, or -1 if @str is nul-terminated.
937 * Converts a string into a form that is independent of case. The
938 * result will not correspond to any particular case, but can be
939 * compared for equality or ordered with the results of calling
940 * g_utf8_casefold() on other strings.
942 * Note that calling g_utf8_casefold() followed by g_utf8_collate() is
943 * only an approximation to the correct linguistic case insensitive
944 * ordering, though it is a fairly good one. Getting this exactly
945 * right would require a more sophisticated collation function that
946 * takes case sensitivity into account. GLib does not currently
947 * provide such a function.
949 * Return value: a newly allocated string, that is a
950 * case independent form of @str.
953 g_utf8_casefold (const gchar *str,
959 g_return_val_if_fail (str != NULL, NULL);
961 result = g_string_new (NULL);
963 while ((len < 0 || p < str + len) && *p)
965 gunichar ch = g_utf8_get_char (p);
968 int end = G_N_ELEMENTS (casefold_table);
970 if (ch >= casefold_table[start].ch &&
971 ch <= casefold_table[end - 1].ch)
975 int half = (start + end) / 2;
976 if (ch == casefold_table[half].ch)
978 g_string_append (result, casefold_table[half].data);
981 else if (half == start)
983 else if (ch > casefold_table[half].ch)
990 g_string_append_unichar (result, g_unichar_tolower (ch));
993 p = g_utf8_next_char (p);
996 return g_string_free (result, FALSE);
1000 * g_unichar_get_mirror_char:
1001 * @ch: a unicode character
1002 * @mirrored_ch: location to store the mirrored character
1004 * In Unicode, some characters are <firstterm>mirrored</firstterm>. This
1005 * means that their images are mirrored horizontally in text that is laid
1006 * out from right to left. For instance, "(" would become its mirror image,
1007 * ")", in right-to-left text.
1009 * If @ch has the Unicode mirrored property and there is another unicode
1010 * character that typically has a glyph that is the mirror image of @ch's
1011 * glyph and @mirrored_ch is set, it puts that character in the address
1012 * pointed to by @mirrored_ch. Otherwise the original character is put.
1014 * Return value: %TRUE if @ch has a mirrored character, %FALSE otherwise
1019 g_unichar_get_mirror_char (gunichar ch,
1020 gunichar *mirrored_ch)
1022 gint pos, step, size;
1026 mirrored = GLIB_GET_MIRRORING(ch);
1028 found = ch != mirrored;
1030 *mirrored_ch = mirrored;
1036 #define __G_UNIPROP_C__
1037 #include "galiasdef.c"