changeset 31458:ec8a58b2ec83

(detect_coding_sjis): Check the byte sequence more regidly.
author Kenichi Handa <handa@m17n.org>
date Thu, 07 Sep 2000 12:58:15 +0000
parents b1c66af9aba5
children 5b606f4bf4f7
files src/coding.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/coding.c	Thu Sep 07 12:41:37 2000 +0000
+++ b/src/coding.c	Thu Sep 07 12:58:15 2000 +0000
@@ -2266,10 +2266,15 @@
   while (1)
     {
       ONE_MORE_BYTE (c);
-      if ((c >= 0x80 && c < 0xA0) || c >= 0xE0)
+      if (c >= 0x81)
 	{
-	  ONE_MORE_BYTE (c);
-	  if (c < 0x40)
+	  if (c <= 0x9F || (c >= 0xE0 && c <= 0xEF))
+	    {
+	      ONE_MORE_BYTE (c);
+	      if (c < 0x40 || c == 0x7F || c > 0xFC)
+		return 0;
+	    }
+	  else if (c > 0xDF)
 	    return 0;
 	}
     }