diff options
author | 2015-06-07 17:37:34 +0200 | |
---|---|---|
committer | 2015-06-07 17:37:34 +0200 | |
commit | b6ce8ee991c7e14ca214a2931bfbc4e4a5a0dc0f (patch) | |
tree | da1e239053b7bfd9e841a103bbb36aefb71c4e7f /src/lib/util/unicode.c | |
parent | b6a4cf45ca6fdf842b319806d61d638cf2d8b2d2 (diff) |
Licenses for Raphael Nabet (nw)
Diffstat (limited to 'src/lib/util/unicode.c')
-rw-r--r-- | src/lib/util/unicode.c | 20 |
1 files changed, 20 insertions, 0 deletions
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); |