added converting additional UTF-8 characters to internal format
authorHolger Schemel <holger.schemel@virtion.de>
Fri, 8 Nov 2024 20:18:40 +0000 (21:18 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Fri, 8 Nov 2024 16:20:02 +0000 (17:20 +0100)
src/libgame/misc.c

index 8003dda8b4123d04a3cd94a22c5433d2de159c9c..15c46411a1cdd35dca7c940db74d20def68a619e 100644 (file)
@@ -2350,7 +2350,18 @@ char *getLatin1FromUTF8(char *utf8)
             src[1] >= 128 && src[1] < 192 &&
             src[2] >= 128 && src[2] < 192)
     {
-      *dst++ = '?';
+      // detect and substitute selected UTF-8 characters
+      if (src[0] == 226 &&
+          src[1] == 128 &&
+          src[2] >= 152 && src[2] <= 155)
+        *dst++ = '\'';
+      else if (src[0] == 226 &&
+               src[1] == 128 &&
+               src[2] >= 156 && src[2] <= 159)
+        *dst++ = '"';
+      else
+        *dst++ = '?';
+
       src += 3;
     }
     else if (src[0] >= 240 && src[0] < 248 &&