[Ttssh2-commit] [7964] 日本語,韓国語で受信できるようになった

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 8月 15日 (木) 23:03:09 JST


Revision: 7964
          https://osdn.net/projects/ttssh2/scm/svn/commits/7964
Author:   zmatsuo
Date:     2019-08-15 23:03:09 +0900 (Thu, 15 Aug 2019)
Log Message:
-----------
日本語,韓国語で受信できるようになった

Modified Paths:
--------------
    branches/unicode_buf/teraterm/teraterm/vtterm.c

-------------- next part --------------
Modified: branches/unicode_buf/teraterm/teraterm/vtterm.c
===================================================================
--- branches/unicode_buf/teraterm/teraterm/vtterm.c	2019-08-15 14:02:49 UTC (rev 7963)
+++ branches/unicode_buf/teraterm/teraterm/vtterm.c	2019-08-15 14:03:09 UTC (rev 7964)
@@ -38,6 +38,7 @@
 #include <ctype.h>
 #include <crtdbg.h>
 #include <tchar.h>
+#include <assert.h>
 
 #include "buffer.h"
 #include "ttwinman.h"
@@ -784,7 +785,32 @@
 		Special = FALSE;
 	}
 
+#if 1
+	{
+		// codepage\x88ꗗ
+		// https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-ucoderef/28fefe92-d66c-4b03-90a9-97b473223d43
+		unsigned long u32 = 0;
+		if (ts.Language == IdKorean) {
+			unsigned char buf[2];
+			int ret;
+			wchar_t wchar;
+			buf[0] = Kanji >> 8;
+			buf[1] = Kanji & 0xff;
+			ret = MultiByteToWideChar(51949, MB_ERR_INVALID_CHARS, (char *)buf, 2, &wchar, 1);
+			u32 = wchar;
+			BuffPutUnicode(u32, CharAttrTmp, InsertMode);
+		} else if (ts.Language == IdJapanese) {
+			// \x82\xB1\x82\xB1\x82ɗ\x88\x82\xBD\x8E\x9E\x93_\x82\xC5CP932\x82ɂȂ\xC1\x82Ă\xA2\x82\xE9
+			//} else if (ts.KanjiCode == IdSJIS || ts.KanjiCode == IdEUC || ts.KanjiCode == IdJIS) {
+			u32 = CP932ToUTF32(Kanji);
+			BuffPutUnicode(u32, CharAttrTmp, InsertMode);
+		} else {
+			assert(FALSE);
+		}
+	}
+#else
 	BuffPutKanji(Kanji, CharAttrTmp, InsertMode);
+#endif
 
 	if (CursorX < LineEnd - 1) {
 		MoveRight();
@@ -5385,10 +5411,12 @@
 
 static void ParseASCII(BYTE b)
 {
+#if 0
 	if (ts.Language == IdJapanese) {
 		ParseFirstJP(b);
 		return;
 	}
+#endif
 
 	if (SSflag) {
 		PutChar(b);


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