Re: a more secured g_utf8_strreverse



On Fri, 2004-06-25 at 10:19, BENOIT CARPENTIER wrote:
> Hi,
> 
> In gdk, gtk+ 2.4.3, the function g_utf8_strreverse.
> a const gchar * is passed as an argument to this
> function.
> It should be tested as an utf8 string, and if it is
> not an utf8 string then be translated into an utf8
> string.
> What do you think of that ?

GTK+ functions that operate on UTF-8 data universally assume
that they are passed valid UTF-8 data.

This is necessary for two reasons:

 - Performance. Continually checking for UTF-8 validity
   would drastically slow down GTK+.

 - If you have a string that's not UTF-8, you have no
   idea what encoding it is in. So you can't convert it
   to UTF-8.

Regards,
					Owen


Attachment: signature.asc
Description: This is a digitally signed message part



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