On 2025-01-03 05:09, Bruno Haible via Gnulib discussion list wrote:
When we offer startswith() and endswith() functions for plain unibyte C strings,
we need to do the same with multibyte strings as well.
Some comments:
* The comments in string.in.h should be imperative sentences. E.g., say
"Return true if ..." not "Returns true if ...". Doing it this way is a
bit briefer and is more likely to result in valid English sentences.
* These functions return int 1 or 0. Why not bool? Are you thinking of
extending them later? If not, bool seems like the way to go.
* With these long names, the table in "Comparison of string APIs" no
longer lines up.
* What happens when strings contain encoding errors? It's not clear from
the spec. I hope behavior isn't simply undefined.
* Can't mbs_endwith be optimized to be just str_endswith in a
single-byte or UTF-8 locale?