From 8ad4f6b4374dac755037f95bd711b4557bc9738f Mon Sep 17 00:00:00 2001 From: Sander van Dijk Date: Sat, 20 Sep 2014 17:46:23 +0000 Subject: [PATCH] in_sdl.c: SDL2: skip over UTF-8 multibyte characters. Before, we stopped processing at the first byte of a multibyte character, now we skip over the bytes of a multibyte character and continue. This will probably not have a noticeable effect, but it's arguably more correct. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1040 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/in_sdl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Quake/in_sdl.c b/Quake/in_sdl.c index b1674367..263f88f0 100644 --- a/Quake/in_sdl.c +++ b/Quake/in_sdl.c @@ -530,8 +530,9 @@ void IN_SendKeyEvents (void) if (!Key_ConsoleBindable(lastKeyDown)) { unsigned char *ch; - for (ch = (unsigned char *)event.text.text; ch[0] != 0 && ch[0] < 128; ch++) - Char_Event (ch[0]); + for (ch = (unsigned char *)event.text.text; ch[0] != 0; ch++) + if ((ch[0] & 0x80) == 0) + Char_Event (ch[0]); } break; #endif