[gcompris-devel] gletter bug

Yan Seiner yan at cardinalengineering.com
Wed Mar 24 02:13:07 UTC 2004


Yan Seiner wrote:

> Bruno:
> 
> I wonder if that's a bug in your glibc...  Certainly the gnome docs 
> sound like that should not be necessary...  But it can't hurt.
> 
> I would also check wordsgame since that's where I lifted that code from. 
>  wordgame.c has the following code:
> 
>   sprintf(utf8char, "%c", gdk_keyval_to_unicode(keyval));
>   g_unichar_to_utf8 (gdk_keyval_to_unicode(keyval),
>              utf8char);
> 
> I couldn't find a purpose for the sprintf statement so I got rid of it.

I should have added that perhaps its only purpose is to add a trailing '\0'?

Also makes me wonder if the 6 byte size for UTF-8 strings includes a 
trailing '\0'?  If it's not a bug, then should we be using 7-byte 
buffers to accomodate the trailing '\0'? Anyone know the max size of a 
UTF-8 string?

--Yan


-- 
         o
      /\ /_       o__
    o*  ~(_)      ,>/'_      o__
Yan Seiner, PE  (_)\(_)     ,>/'_   o__     o__
Cardinal Engineering, Inc. (_)\(_)  ,>/'_   ,>/'_
http://www.cardinalengineering.com (_)\(_) (_)\(_)
spam killer code kpwq1jkcsEzdx39gnkVvgycd15ayqq





More information about the Gcompris-devel mailing list