mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Merge pull request #1183 from ailin-nemui/glib-2-63
manually handle NUL unicode in g_utf8_get_next_char_validated
This commit is contained in:
commit
76802985a4
@ -674,6 +674,10 @@ static int input_utf8(const unsigned char *buffer, int size, unichar *result)
|
||||
{
|
||||
unichar c = g_utf8_get_char_validated((char *) buffer, size);
|
||||
|
||||
/* GLib >= 2.63 do not accept Unicode NUL anymore */
|
||||
if (c == (unichar) -2 && *buffer == 0 && size > 0)
|
||||
c = 0;
|
||||
|
||||
switch (c) {
|
||||
case (unichar)-1:
|
||||
/* not UTF8 - fallback to 8bit ascii */
|
||||
|
Loading…
Reference in New Issue
Block a user