1
0
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:
ailin-nemui 2020-07-08 17:43:11 +02:00 committed by GitHub
commit 76802985a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 */