On 07/29/2010 05:36 PM, Bruno Haible wrote:
You should better use u8_strmbtouc in this case.
Aha, that's true. This function is a better match, but only because it supports CONFIG_UNICODE_SAFETY and is faster in that case (because it can just compare with zero).
Still, without safety u8_strmbtouc(puc, s) uses the same code as u8_mbtouc(puc, s, SIZE_MAX), which makes pretty much my point. I think it is safe and actually very useful to document u8_mbtouc/u16_mbtouc as looking only one byte (resp. one short) beyond the first complete character.
Paolo