improve z_check_unicode
authorborg323 <4010067-borg323@users.noreply.gitlab.com>
Wed, 22 May 2019 21:06:18 +0000 (00:06 +0300)
committerDavid Griffith <dave@661.org>
Mon, 27 May 2019 02:32:11 +0000 (19:32 -0700)
src/common/text.c

index 0e7edb38ed6e3be30eb223f58e3aa51eec907893..f7faf277f03961bbd85d035008084aa8c26e189a 100644 (file)
@@ -334,11 +334,16 @@ void z_check_unicode (void)
        store (3);
     else if (c == 0xa0)
        store (1);
+#ifndef USE_UTF8
+    else if (c >= 0xa1 && c <= 0xff)
+       store (3);
+#else
     else if (c >= 0xa1)
-       /* being optimistic, we can print and input
-        * all unicode characters
+       /* being optimistic, we can print all unicode characters
+        * and input the ones with zscii representation
         */
-       store (3);
+       store ((unicode_to_zscii (c) != 0) ? 3 : 1);
+#endif
     else
        store (0);