From 978845bb7423e76ff99b9dc98dbe93315b732338 Mon Sep 17 00:00:00 2001 From: blub Date: Tue, 5 Jan 2010 20:04:38 +0000 Subject: [PATCH] with utf8 disabled VM_str2chr should not use U+E0xx codes git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9792 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_cmds.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/prvm_cmds.c b/prvm_cmds.c index 69db32ca..eb572503 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -5057,7 +5057,10 @@ void VM_str2chr (void) if((unsigned)index < strlen(s)) { - ch = u8_getchar_noendptr(s + index); + if (utf8_enable.integer) + ch = u8_getchar_noendptr(s + index); + else + ch = s[index]; PRVM_G_FLOAT(OFS_RETURN) = ch; } else -- 2.39.2