[Ttssh2-commit] [3446] UTF-8で2バイトになる文字の表示が遅れるのを修正。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 6月 7日 (日) 17:39:00 JST


Revision: 3446
          http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3446
Author:   doda
Date:     2009-06-07 17:39:00 +0900 (Sun, 07 Jun 2009)

Log Message:
-----------
UTF-8で2バイトになる文字の表示が遅れるのを修正。

Modified Paths:
--------------
    trunk/teraterm/teraterm/vtterm.c


-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2009-06-07 07:22:05 UTC (rev 3445)
+++ trunk/teraterm/teraterm/vtterm.c	2009-06-07 08:39:00 UTC (rev 3446)
@@ -3161,43 +3161,39 @@
 		}
 	}
 
+	buf[count++] = b;
 	if (count < 2) {
-		buf[count++] = b;
 		return TRUE;
 	}
 
 	memset(mbchar, 0, sizeof(mbchar));
 
 	// 2ƒoƒCƒgƒR[ƒh‚̏ꍇ
-	if ((buf[0] & 0xe0) == 0xc0 &&
-		(buf[1] & 0xc0) == 0x80) {
+	if ((buf[0] & 0xe0) == 0xc0) {
+		if ((buf[1] & 0xc0) == 0x80) {
 
-		if (hfsplus_mode == 1 && maybe_hfsplus == 1) {
-			UnicodeToCP932(first_code);
-			maybe_hfsplus = 0;
-		}
+			if (hfsplus_mode == 1 && maybe_hfsplus == 1) {
+				UnicodeToCP932(first_code);
+				maybe_hfsplus = 0;
+			}
 
-		code = ((buf[0] & 0x1f) << 6);
-		code |= ((buf[1] & 0x3f));
+			code = ((buf[0] & 0x1f) << 6);
+			code |= ((buf[1] & 0x3f));
 
-		UnicodeToCP932(code);
-
-		// ŽŸ‚̃oƒCƒg‚ªASCII‚È‚ç‚»‚Ì‚Ü‚Ü•\Ž¦ (2006.6.30 yutaka)
-		if ((b & 0x80) != 0x80) { // ASCII(0x00-0x7f)
-			ParseASCII(b);
-			count = 0;  // reset counter
-
-		} else {
-			// ASCII‚Å‚È‚¢‚Ì‚È‚çAƒ}ƒ‹ƒ`ƒoƒCƒg•¶Žš‚ÌŽn‚Ü‚è‚ÆŒ©‚È‚·B
-			buf[0] = b;
-			count = 1;
+			UnicodeToCP932(code);
 		}
+		else {
+			ParseASCII(buf[0]);
+			ParseASCII(buf[1]);
+		}
+		count = 0;
+		return TRUE;
+	}
 
+	if (count < 3) {
 		return TRUE;
 	}
 
-	buf[count++] = b;
-
 	if ((buf[0] & 0xe0) == 0xe0 &&
 		(buf[1] & 0xc0) == 0x80 &&
 		(buf[2] & 0xc0) == 0x80) { // 3ƒoƒCƒgƒR[ƒh‚̏ꍇ



Ttssh2-commit メーリングリストの案内
Back to archive index