From: divverent Date: Sun, 12 Dec 2010 20:50:15 +0000 (+0000) Subject: fix sys_specialcharactertranslation for utf-8 mode X-Git-Tag: xonotic-v0.5.0~438^2~183 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=1b1a05b13477696088ac74f71a0fdb1277db4f49;p=xonotic%2Fdarkplaces.git fix sys_specialcharactertranslation for utf-8 mode git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10658 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/console.c b/console.c index 0eaccd3e..8a3fa90f 100644 --- a/console.c +++ b/console.c @@ -1115,11 +1115,24 @@ void Con_MaskPrint(int additionalmask, const char *msg) // send to terminal or dedicated server window if (!sys_nostdout) { - unsigned char *p; if(sys_specialcharactertranslation.integer) { - for (p = (unsigned char *) line;*p; p++) - *p = qfont_table[*p]; + char *p; + const char *q; + p = line; + while(*p) + { + int ch = u8_getchar(p, &q); + if(ch >= 0xE000 && ch <= 0xE0FF) + { + *p = qfont_table[ch - 0xE000]; + if(q > p+1) + memmove(p+1, q, strlen(q)); + p = p + 1; + } + else + p = p + (q - p); + } } if(sys_colortranslation.integer == 1) // ANSI