On 04 May 2001 11:54:42 -0400, Jon Trowbridge wrote:
> On Fri, May 04, 2001 at 01:49:21PM +0200, Gediminas Paulauskas wrote:
> > We can fix Evolution but we don't know who else uses GAL. So the fix
> > should be general, and placed in GAL/GLib.
> > 
> > all these "broken" functions shouldn't do any checks on validity then,
> > but at the top include a check
> > 
> > g_return_if_fail(g_utf8_validate(str) == TRUE);
> > 
> > That's how everything else is checked for validity. Except that not
> > everything depends on programmer, there may be non-valid messages,
> > b0rked setups etc.
> 
> Well, you can make a good case that it is inefficient to do these
> validity checks every time.

I disagree.

There should be little performance impact of actually having the code
CHECK the bloody text that its processing WHILE its doing it.  It is
like so trivial to do this given all of the other processing you need to
do.  Somehow they've managed to construct all of the utf8 processing
functions in such a way as there is no efficient way to do this though.
Having a separate validate function is just entirely stupid, as you will
ALWAYS need to run it anyway on every bloody string you use.

> That said, it might be good to have some sort of "failsafe mode"
> which fills gutf8.c with a bunch of
> 
> #ifdef UTF8_FAILSAFE
>   g_assert (g_utf8_validate (str));
> #endif

This is basically a waste of time.

It needs to detect it while running every time.

> constructs, just to help us find the problems.  After all, invalid inputs
> won't always cause segfaults or lockups, but can also lead to bogus
> results that cause a segfault/lockup later, and these could turn out
> to be very difficult to track down...
> 
> -JT
> 
> 
> _______________________________________________
> evolution-hackers maillist  -  [EMAIL PROTECTED]
> http://lists.helixcode.com/mailman/listinfo/evolution-hackers


_______________________________________________
evolution-hackers maillist  -  [EMAIL PROTECTED]
http://lists.helixcode.com/mailman/listinfo/evolution-hackers

Reply via email to