1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 08:13:14 +02:00

api: add argument "length" in function utf8_is_valid()

This commit is contained in:
Sébastien Helleu
2015-08-18 07:36:48 +02:00
parent fd1886e883
commit 46a9d17ac3
13 changed files with 188 additions and 46 deletions
+1 -1
View File
@@ -378,7 +378,7 @@ gui_key_flush (int paste)
ptr_char = key_str;
while (ptr_char && ptr_char[0])
{
(void) utf8_is_valid (ptr_char, &ptr_error);
(void) utf8_is_valid (ptr_char, -1, &ptr_error);
if (!ptr_error)
break;
next_char = (char *)utf8_next_char (ptr_error);
+1 -1
View File
@@ -265,7 +265,7 @@ gui_mouse_event_code2key (const char *code)
* mouse code must have at least:
* one code (for event) + X + Y == 3 bytes or 3 UTF-8 chars
*/
code_utf8 = utf8_is_valid (code, NULL);
code_utf8 = utf8_is_valid (code, -1, NULL);
length = (code_utf8) ? utf8_strlen (code) : (int)strlen (code);
if (length < 3)
return NULL;
+1 -1
View File
@@ -214,7 +214,7 @@ gui_key_grab_end_timer_cb (void *data, int remaining_calls)
* but some mouse codes can return ISO chars (for coordinates),
* then we will convert them to UTF-8 string
*/
if (!utf8_is_valid (expanded_key, NULL))
if (!utf8_is_valid (expanded_key, -1, NULL))
{
expanded_key2 = string_iconv_to_internal ("iso-8859-1",
expanded_key);