Re: UTF8 utils, g_utf8_strstr() g_utf8_strcasestr()?



On 5/15/06, Andrew Paprocki <andrew ishiboo com> wrote:
Forgive me if there is already an easy way to do this, but I didn't see it browsing through gunicode.h. Is there any interest in a g_utf8_strstr() function? It seems like strchr() was provided, but strstr() was omitted. In addition, I am finding in my daily routine that I need to do a lot of utf8 case-insensitive substring searches. It seems like overkill to g_utf8_strup() tons of strings to do a strstr(), so I'm thinking an in-place g_utf8_strcasestr() (following naming convention of strcasecmp) would be useful to implement? If there is interest, I could wrap up what I have and submit the patch. If this already exists in some form, let me know, thanks!

#define g_utf8_strstr strstr

works just fine.

Case-insensitive substring searches in Unicode is not trivial at all,
since you have to cater for things like titlecase or case-conversions
which change
the number of characters.

Matthias



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]