From b6ce8ee991c7e14ca214a2931bfbc4e4a5a0dc0f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 7 Jun 2015 17:37:34 +0200 Subject: Licenses for Raphael Nabet (nw) --- src/lib/util/unicode.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/lib/util/unicode.c') diff --git a/src/lib/util/unicode.c b/src/lib/util/unicode.c index c87965415d7..7f264bc1fb6 100644 --- a/src/lib/util/unicode.c +++ b/src/lib/util/unicode.c @@ -308,6 +308,16 @@ int utf16f_from_uchar(utf16_char *utf16string, size_t count, unicode_char uchar) previous character in a string -------------------------------------------------*/ +/** + * @fn const char *utf8_previous_char(const char *utf8string) + * + * @brief UTF 8 previous character. + * + * @param utf8string The UTF 8string. + * + * @return null if it fails, else a char*. + */ + const char *utf8_previous_char(const char *utf8string) { while ((*--utf8string & 0xc0) == 0x80) @@ -322,6 +332,16 @@ const char *utf8_previous_char(const char *utf8string) UTF-8 characters -------------------------------------------------*/ +/** + * @fn int utf8_is_valid_string(const char *utf8string) + * + * @brief UTF 8 is valid string. + * + * @param utf8string The UTF 8string. + * + * @return An int. + */ + int utf8_is_valid_string(const char *utf8string) { int remaining_length = strlen(utf8string); -- cgit v1.2.3-70-g09d2