lq-text: LQU_UTF8LengthFromFirstByte

API unsigned long LQU_UTF8LengthFromFirstByte (c) CONST unsigned char c;

Purpose

Given the first byte of a UTF character sequence, return the total expected length in bytes (at least one byte of course)

Returns

The number of bytes, from 1 to 6.

Notes

Does not handle diacritical marks: a following Unicode character might overlay the current character.