Re: utf8 stristr
- From: Owen Taylor <otaylor redhat com>
- To: Michal Adamczak <pokryfka druid if uj edu pl>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: utf8 stristr
- Date: 31 Mar 2003 12:12:39 -0500
On Mon, 2003-03-31 at 12:08, Michal Adamczak wrote:
strrstr() is not part of standard C, neither is strstr_len() or
strrstr_len(). However, your C library contains a perfectly good
strstr(), so there is no reason to tack a g_ in front of it.
personally i think that they should appear just for consistency
and there should appear replace and regex funcions as well
Regular expressions have been a long standing idea of something to add
to GLib, but we've had the problem that available Regex
implementations don't have good enough UTF-8 handling. Apparently
recent PCRE is distinctly better in that regard.
is sizeof(char) always equals sizeof(utf8_char)?
maybe i am wrong but i thought that soem characters beyond first chars
table
are written with two bytes
if not there's no need for strstr and other at all
but my concern was that the size of one chracter can be 1 or 2 bytes
The strstr() operation doesn't need any UTF-8 support. The way
a string is encoded into UTF-8 is the same no-matter where
it appears in the string.
[ Though normalization may in some cases be necessary if you
actually are doing searching based on user input -- see
g_utf8_normalize() documentation ]
The g_strrstr() and so forth functions aren't there for Unicode
handling , but rather because they are useful in some cases.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]