Re: g_malloc overhead
- From: Xavier Bestel <xavier bestel free fr>
- To: Tor Lillqvist <tml iki fi>
- Cc: gtk-devel-list gnome org, gtk-app-devel-list gnome org, Maciej Piechotka <uzytkownik2 gmail com>
- Subject: Re: g_malloc overhead
- Date: Thu, 29 Jan 2009 16:02:16 +0100
On Thu, 2009-01-29 at 16:51 +0200, Tor Lillqvist wrote:
I think strncpy() is one of the few that needs an utf8 equivalent,
because a char may span several bytes.
Well, he didn't say exactly what semantics he wanted his
g_utf8_strncpy() and g_utf16_strncpy() to have. In the UTF-8 case,
should the "size" mean characters or bytes? In the UTF-16 case,
characters or 16-bit units?
The existing g_utf8_strncpy() has it meaning characters. As such I
think the name is bit unfortunate, because of the similarity to
strncpy() but then different semantics of the "size" parameter.
Even if the meaning was "bytes", I think an utf8-aware function that
avoids cutting in the middle of a multibyte char is a plus.
Xav
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]