Re: RFC/vote: A fl_utf8 function for detecting continuation bytes
Bill Spitzak
14:36 Jul 21
"tail" seems good to me.
You don't need a "head" function. Characters start on !is_tail() bytes. "head" is rather ambiguous as to whether it includes ASCII or invalid bytes, but those all start a character as far as fltk is concerned.
On Mon, Jul 20, 2026 at 12:17 PM Greg Ercolano <erco@seriss.com> wrote:
So how about (which could be confused with the
start and end of a string):
`fl_utf8_is_head()` and `fl_utf8_is_tail()`
or the long version which makes the job very
clear
`fl_utf8_is_leading_byte()` and
`fl_utf8_is_trailing_byte()` or
`fl_utf8_is_continuation_byte()`
Interesting.. but I'mma stick with (2) for fltk_utf8_is_cont()
or even fltk_utf8_is_continuation() because that prevents
needing two functions (e.g. head vs. tail), since is_continuation()
covers both by simply telling you if you're 'in the middle or not'.
Also, having one function instead of two means a parent walking
the string either 'to the beginning' or 'to the end' doesn't have to
worry about using the wrong function accidentally.
Comments are owned by the poster. All other content is copyright 1998-2026 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.