1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 01:33:12 +02:00

core: return number of bytes for UTF-8 char in function utf8_int_string

This commit is contained in:
Sébastien Helleu
2022-12-17 20:25:07 +01:00
parent 6aedddd351
commit eb6cc0bc2a
4 changed files with 27 additions and 12 deletions
+6 -6
View File
@@ -458,16 +458,16 @@ TEST(CoreUtf8, Convert)
LONGS_EQUAL(0x92d, utf8_char_int (utf8_4bytes_truncated_3));
/* convert unicode char to a string */
utf8_int_string (0, NULL);
utf8_int_string (0, result);
LONGS_EQUAL(0, utf8_int_string (0, NULL));
LONGS_EQUAL(0, utf8_int_string (0, result));
STRCMP_EQUAL("", result);
utf8_int_string (235, result);
LONGS_EQUAL(2, utf8_int_string (L'ë', result));
STRCMP_EQUAL("ë", result);
utf8_int_string (0x20ac, result);
LONGS_EQUAL(3, utf8_int_string (L'', result));
STRCMP_EQUAL("", result);
utf8_int_string (0x2ee9, result);
LONGS_EQUAL(3, utf8_int_string (0x2ee9, result));
STRCMP_EQUAL(UNICODE_CJK_YELLOW, result);
utf8_int_string (0x24b62, result);
LONGS_EQUAL(4, utf8_int_string (0x24b62, result));
STRCMP_EQUAL(UNICODE_HAN_CHAR, result);
/* get wide char */