diff options
Diffstat (limited to 'src/util/UTF8.hxx')
-rw-r--r-- | src/util/UTF8.hxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util/UTF8.hxx b/src/util/UTF8.hxx index d3d694f6b..82d324f3e 100644 --- a/src/util/UTF8.hxx +++ b/src/util/UTF8.hxx @@ -43,6 +43,22 @@ bool ValidateUTF8(const char *p); /** + * @return the number of the sequence beginning with the given + * character, or 0 if the character is not a valid start byte + */ +gcc_const +size_t +SequenceLengthUTF8(char ch); + +/** + * @return the number of the first sequence in the given string, or 0 + * if the sequence is malformed + */ +gcc_pure +size_t +SequenceLengthUTF8(const char *p); + +/** * Convert the specified string from ISO-8859-1 to UTF-8. * * @return the UTF-8 version of the source string; may return #src if |