On 17 Jan 2009, at 0:16, Alvin wrote:

> I'm using FLTK 1.3 r6634 and I am seeing a potential off-by-one  
> error with
> Fl:event_length(). In past revision of FLTK 1.3.x, Fl::event_length 
> () would
> return the number of bytes stored in Fl::event_text() (upon  
> receiving a
> FL_PASTE after a FL_DND_RELEASE event). However, what I am seeing  
> now is
> the Fl::event_length() is returning the number of characters. The
> difference this make is that the null-terminator is not included in  
> the
> count returned by Fl::event_length().

Going off at a tangent...

I should probably know this, but right now I can't remember - what  
does Fl::event_length() return for a UTF-8 string?

If it is indeed literally "characters" rather than "bytes" then  
Alvin's approach (which I know is widely used in C-style languages  
everywhere) to ensuring the string is NULL-terminated, is not going  
to work, as many strings will have far more bytes than characters, in  
general.

-- 
Ian




_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to