Re: GLib substr function
- From: "Freddie Unpenstein" <fredderic excite com>
- To: daniele maio gmail com,stef memberwebs com
- Cc: gtk-devel-list gnome org
- Subject: Re: GLib substr function
- Date: Fri, 10 Apr 2009 22:50:57 -0400
From: "Stef Walter", Date: 11/04/2009 03:45, Wrote:
>>> substring (GString *str, int index, int len)
>>> {
>>> return g_string_new_len (str->str, index, MIN (str->len - index, len));
>>> }
>> I was wondering why not to add a so simple example in the official docs
>> (maybe in the g_strndup explanation).
> Maybe because it's completely wrong for UTF-8 strings?
Why, then, doesn't glib come with a completely right implementation?
Basic string operations like sub-string and string replace, should be part of glib, and for every string format that glib supports (including plain ASCII). Especially when it's so obvious that a lot of people still do it incorrectly.
Fredderic
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]