Me: >> As well as being able to count forward by the correct number of >> bytes, in order to move the cursor right by one character for >> example, we also need to be able to count backward by the correct >> number of bytes, eg to move the cursor left. And counting backwards >> now seems to be a more complicated action, because now we need to >> know the preceding bytes too.
Ian: > I think if we use the functions from fl_utf.c (which are mainly > cloned from fltk2's utf.c) this is all taken care of. > > I'm pretty sure that at some point (when I was hacking away at the > fltk-1.1.8 utf8 port) I had this working for "normal" widgets, ... I will look at the fl_utf8fwd() and fl_utf8back() function tonight, if I have time, to see how they handle the following byte sequences: a a a^123 X a a a a a 123 X^a a a a X X^X X a a where 'a' is an ascii byte (0x01-0x7f), 'X' is a CP1252 byte (0x8-0x9f) and '1' is a utf-8 header byte and '2' and '3' are utf-8 trailer bytes, and '^' represents the current index pointing to the byte on the right. After tonight, I have guests, and the computer is in the guest room... Cheers D. _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
