1 #include "unicode-util.h"
3 /* Based on Xapian::Unicode::is_wordchar, to avoid forcing clients to
4 link directly to libxapian.
8 unicode_is_wordchar (notmuch_unichar ch)
10 switch (g_unichar_type (ch)) {
11 case G_UNICODE_UPPERCASE_LETTER:
12 case G_UNICODE_LOWERCASE_LETTER:
13 case G_UNICODE_TITLECASE_LETTER:
14 case G_UNICODE_MODIFIER_LETTER:
15 case G_UNICODE_OTHER_LETTER:
16 case G_UNICODE_NON_SPACING_MARK:
17 case G_UNICODE_ENCLOSING_MARK:
18 case G_UNICODE_SPACING_MARK:
19 case G_UNICODE_DECIMAL_NUMBER:
20 case G_UNICODE_LETTER_NUMBER:
21 case G_UNICODE_OTHER_NUMBER:
22 case G_UNICODE_CONNECT_PUNCTUATION:
30 unicode_word_utf8 (const char *utf8_str)
32 gunichar *decoded = g_utf8_to_ucs4_fast (utf8_str, -1, NULL);
33 const gunichar *p = decoded;
36 while (*p && unicode_is_wordchar (*p))