]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
with utf8 disabled VM_str2chr should not use U+E0xx codes
authorblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 5 Jan 2010 20:04:38 +0000 (20:04 +0000)
committerblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 5 Jan 2010 20:04:38 +0000 (20:04 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9792 d7cf8633-e32d-0410-b094-e92efae38249

prvm_cmds.c

index 69db32caaffddbc6e967c4aca295c1e4c9d3a350..eb572503ac6fe02bbd30f916f8b57cd83e1888d9 100644 (file)
@@ -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