Revision: 10801 https://osdn.net/projects/ttssh2/scm/svn/commits/10801 Author: zmatsuo Date: 2023-07-08 01:10:06 +0900 (Sat, 08 Jul 2023) Log Message: ----------- UTF8Fallback を FallbackToCP932 に変更、TERATERM.INI に保存するようにした - 日本語UTF-8以外ではfallbackしないように修正 - 修正前はISO8859-1にfallbackしていた ticket #48226 Ticket Links: ------------ https://osdn.net/projects/ttssh2/tracker/detail/48226 Modified Paths: -------------- trunk/doc/en/html/setup/teraterm-ini.html trunk/doc/en/html/setup/teraterm-term.html trunk/doc/en/html/setup/teraterm.html trunk/doc/ja/html/setup/teraterm-ini.html trunk/doc/ja/html/setup/teraterm-term.html trunk/doc/ja/html/setup/teraterm.html trunk/installer/release/TERATERM.INI trunk/teraterm/common/tttypes.h trunk/teraterm/teraterm/charset.cpp trunk/teraterm/ttpset/ttset.c -------------- next part -------------- Modified: trunk/doc/en/html/setup/teraterm-ini.html =================================================================== --- trunk/doc/en/html/setup/teraterm-ini.html 2023-07-07 16:09:54 UTC (rev 10800) +++ trunk/doc/en/html/setup/teraterm-ini.html 2023-07-07 16:10:06 UTC (rev 10801) @@ -1346,7 +1346,7 @@ <td></td> </tr> <tr> - <td id="UTF8Fallback"><a href="teraterm-win.html#color">UTF8Fallback</a></td> + <td id="FallbackToCP932"><a href="teraterm-win.html#color">FallbackToCP932</a></td> <td style="width:250px;">off</td> <td style="width:250px;"><-</td> <td></td> Modified: trunk/doc/en/html/setup/teraterm-term.html =================================================================== --- trunk/doc/en/html/setup/teraterm-term.html 2023-07-07 16:09:54 UTC (rev 10800) +++ trunk/doc/en/html/setup/teraterm-term.html 2023-07-07 16:10:06 UTC (rev 10801) @@ -580,24 +580,19 @@ FixedJIS=off </pre> -<h1 id="UTF8Fallback">\x95s\x90\xB3\x82\xC8UTF-8\x95\xB6\x8E\x9A\x82𑼂̕\xB6\x8E\x9A\x83R\x81[\x83h\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB7\x82\xE9</h1> +<h1 id="FallbackToCP932">\x95s\x90\xB3\x82\xC8UTF-8\x95\xB6\x8E\x9A\x82\xF0CP932\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB7\x82\xE9</h1> <p> -\x8E\xF3\x90M\x95\xB6\x8E\x9A\x82\xAAUTF-8\x82̂Ƃ\xAB\x82ɁAUTF-8\x82Ƃ\xB5\x82ĕs\x90\xB3\x82ȕ\xB6\x8E\x9A\x82\xF0\x81A\x91\xBC\x82̕\xB6\x8E\x9A\x83R\x81[\x83h\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB5\x82܂\xB7\x81B\x8E\xC0\x8C\xB1\x93I\x8E\xC0\x91\x95\x82ł\xB7\x81B\x82\xB1\x82̐ݒ\xE8\x82\xCDRead Only\x82ł\xB7\x81B +\x8E\xF3\x90M\x95\xB6\x8E\x9A\x82\xAAUTF-8\x82̂Ƃ\xAB\x82ɁAUTF-8\x82Ƃ\xB5\x82ĕs\x90\xB3\x82ȕ\xB6\x8E\x9A\x82\xF0\x81A\x91\xBC\x82̕\xB6\x8E\x9A\x83R\x81[\x83h\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB5\x82܂\xB7\x81B\x8E\xC0\x8C\xB1\x93I\x8E\xC0\x91\x95\x82ł\xB7\x81B +</p> <p> -\x8E\xC0\x8C\xB1\x93I\x8E\xC0\x91\x95\x82\xBE\x82\xC1\x82\xBD FallbackToCP932 \x82\xF0 CP932 \x82\xC6 ISO8859-1 \x82Ɋg\x92\xA3\x82\xB5\x82܂\xB5\x82\xBD\x81B +Cygwin\x90ڑ\xB1\x8E\x9E\x82\xC9Windows\x95t\x91\xAE\x83R\x83}\x83\x93\x83h\x82̏o\x97͂\xAACP932\x82ōs\x82\xED\x82\xEA\x82鎖\x82ɑΉ\x9E\x82\xB7\x82邽\x82߂̂\xE0\x82̂ŁA\x82\xBB\x82\xEA\x88ȊO\x82̃P\x81[\x83X\x82͑z\x92肵\x82Ă\xA2\x82܂\xB9\x82\xF1\x81B +</p> -<dl> - <dt>\x8C\xBE\x8CꂪJapanese\x82̏ꍇ</dt> - <dd>CP932(Shift_JIS)</dd> - <dt>\x82\xBB\x82̑\xBC\x82̏ꍇ</dt> - <dd>ISO8859-1</dd> -</dl> - <pre> \x8Fȗ\xAA\x8E\x9E: -UTF8Fallback=off +FallbackToCP932=off </pre> </BODY> Modified: trunk/doc/en/html/setup/teraterm.html =================================================================== --- trunk/doc/en/html/setup/teraterm.html 2023-07-07 16:09:54 UTC (rev 10800) +++ trunk/doc/en/html/setup/teraterm.html 2023-07-07 16:10:06 UTC (rev 10801) @@ -83,7 +83,7 @@ <li><a href="teraterm-term.html#BellLimiting">Limited BEL Over</a></li> <li><a href="teraterm-term.html#ISO2022ShiftFunction">Disabling ISO/IEC 2022 shift function</a></li> <li><a href="teraterm-term.html#FIXEDJIS">7bit JIS\x83J\x83^\x83J\x83i(\x90\xEA\x97p)\x92[\x96\x96\x82Ƃ\xB5\x82Ďg\x97p\x82\xB7\x82\xE9</a></li> - <li><a href="teraterm-term.html#UTF8Fallback">\x95s\x90\xB3\x82\xC8UTF-8\x95\xB6\x8E\x9A\x82𑼂̕\xB6\x8E\x9A\x83R\x81[\x83h\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB7\x82\xE9</a></li> + <li><a href="teraterm-term.html#FallbackToCP932">\x95s\x90\xB3\x82\xC8UTF-8\x95\xB6\x8E\x9A\x82\xF0CP932\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB7\x82\xE9</a></li> </ul> <h3>Window</h3> Modified: trunk/doc/ja/html/setup/teraterm-ini.html =================================================================== --- trunk/doc/ja/html/setup/teraterm-ini.html 2023-07-07 16:09:54 UTC (rev 10800) +++ trunk/doc/ja/html/setup/teraterm-ini.html 2023-07-07 16:10:06 UTC (rev 10801) @@ -1352,7 +1352,7 @@ <td></td> </tr> <tr> - <td id="UTF8Fallback"><a href="teraterm-win.html#color">UTF8Fallback</a></td> + <td id="FallbackToCP932"><a href="teraterm-win.html#color">FallbackToCP932</a></td> <td style="width:250px;">off</td> <td style="width:250px;"><-</td> <td></td> Modified: trunk/doc/ja/html/setup/teraterm-term.html =================================================================== --- trunk/doc/ja/html/setup/teraterm-term.html 2023-07-07 16:09:54 UTC (rev 10800) +++ trunk/doc/ja/html/setup/teraterm-term.html 2023-07-07 16:10:06 UTC (rev 10801) @@ -649,24 +649,19 @@ FixedJIS=off </pre> -<h1 id="UTF8Fallback">\x95s\x90\xB3\x82\xC8UTF-8\x95\xB6\x8E\x9A\x82𑼂̕\xB6\x8E\x9A\x83R\x81[\x83h\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB7\x82\xE9</h1> +<h1 id="FallbackToCP932">\x95s\x90\xB3\x82\xC8UTF-8\x95\xB6\x8E\x9A\x82\xF0CP932\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB7\x82\xE9</h1> <p> -\x8E\xF3\x90M\x95\xB6\x8E\x9A\x82\xAAUTF-8\x82̂Ƃ\xAB\x82ɁAUTF-8\x82Ƃ\xB5\x82ĕs\x90\xB3\x82ȕ\xB6\x8E\x9A\x82\xF0\x81A\x91\xBC\x82̕\xB6\x8E\x9A\x83R\x81[\x83h\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB5\x82܂\xB7\x81B\x8E\xC0\x8C\xB1\x93I\x8E\xC0\x91\x95\x82ł\xB7\x81B\x82\xB1\x82̐ݒ\xE8\x82\xCDRead Only\x82ł\xB7\x81B +\x8E\xF3\x90M\x95\xB6\x8E\x9A\x82\xAAUTF-8\x82̂Ƃ\xAB\x82ɁAUTF-8\x82Ƃ\xB5\x82ĕs\x90\xB3\x82ȕ\xB6\x8E\x9A\x82\xF0\x81A\x91\xBC\x82̕\xB6\x8E\x9A\x83R\x81[\x83h\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB5\x82܂\xB7\x81B\x8E\xC0\x8C\xB1\x93I\x8E\xC0\x91\x95\x82ł\xB7\x81B +</p> <p> -\x8E\xC0\x8C\xB1\x93I\x8E\xC0\x91\x95\x82\xBE\x82\xC1\x82\xBD FallbackToCP932 \x82\xF0 CP932 \x82\xC6 ISO8859-1 \x82Ɋg\x92\xA3\x82\xB5\x82܂\xB5\x82\xBD\x81B +Cygwin\x90ڑ\xB1\x8E\x9E\x82\xC9Windows\x95t\x91\xAE\x83R\x83}\x83\x93\x83h\x82̏o\x97͂\xAACP932\x82ōs\x82\xED\x82\xEA\x82鎖\x82ɑΉ\x9E\x82\xB7\x82邽\x82߂̂\xE0\x82̂ŁA\x82\xBB\x82\xEA\x88ȊO\x82̃P\x81[\x83X\x82͑z\x92肵\x82Ă\xA2\x82܂\xB9\x82\xF1\x81B +</p> -<dl> - <dt>\x8C\xBE\x8CꂪJapanese\x82̏ꍇ</dt> - <dd>CP932(Shift_JIS)</dd> - <dt>\x82\xBB\x82̑\xBC\x82̏ꍇ</dt> - <dd>ISO8859-1</dd> -</dl> - <pre> \x8Fȗ\xAA\x8E\x9E: -UTF8Fallback=off +FallbackToCP932=off </pre> </BODY> Modified: trunk/doc/ja/html/setup/teraterm.html =================================================================== --- trunk/doc/ja/html/setup/teraterm.html 2023-07-07 16:09:54 UTC (rev 10800) +++ trunk/doc/ja/html/setup/teraterm.html 2023-07-07 16:10:06 UTC (rev 10801) @@ -53,7 +53,7 @@ <li><a href="teraterm-term.html#BellLimitting">\x83x\x83\x8B\x89ߎg\x97p\x8E\x9E\x82̈ꎞ\x96\xB3\x8C\xF8\x89\xBB</a></li> <li><a href="teraterm-term.html#ISO2022ShiftFunction">ISO/IEC 2022\x82̃V\x83t\x83g\x8B@\x94\\x82ɂ\xE6\x82镶\x8E\x9A\x83Z\x83b\x83g\x82̐\xE8\x91ւ\xA6\x82\xF0\x8B֎~\x82\xB7\x82\xE9</a></li> <li><a href="teraterm-term.html#FIXEDJIS">7bit JIS\x83J\x83^\x83J\x83i(\x90\xEA\x97p)\x92[\x96\x96\x82Ƃ\xB5\x82Ďg\x97p\x82\xB7\x82\xE9</a></li> - <li><a href="teraterm-term.html#UTF8Fallback">\x95s\x90\xB3\x82\xC8UTF-8\x95\xB6\x8E\x9A\x82𑼂̕\xB6\x8E\x9A\x83R\x81[\x83h\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB7\x82\xE9</a></li> + <li><a href="teraterm-term.html#FallbackToCP932">\x95s\x90\xB3\x82\xC8UTF-8\x95\xB6\x8E\x9A\x82\xF0CP932\x82Ƃ\xB5\x82ăf\x83R\x81[\x83h\x82\xB7\x82\xE9</a></li> </ul> <h3>\x83E\x83B\x83\x93\x83h\x83E</h3> Modified: trunk/installer/release/TERATERM.INI =================================================================== --- trunk/installer/release/TERATERM.INI 2023-07-07 16:09:54 UTC (rev 10800) +++ trunk/installer/release/TERATERM.INI 2023-07-07 16:10:06 UTC (rev 10801) @@ -788,7 +788,7 @@ UnicodeAmbiguousWidth= UnicodeEmojiOverride= UnicodeEmojiWidth= -UTF8Fallback=off +FallbackToCP932=off [TTSSH] ; SSH enabled flag (1=enabled 0=disabled) Modified: trunk/teraterm/common/tttypes.h =================================================================== --- trunk/teraterm/common/tttypes.h 2023-07-07 16:09:54 UTC (rev 10800) +++ trunk/teraterm/common/tttypes.h 2023-07-07 16:10:06 UTC (rev 10801) @@ -466,7 +466,7 @@ char reserve_LogDefaultPath[MAX_PATH]; // \x94p\x8E~,LogDefaultPathW \x82ֈڍs WORD LogAutoStart; unsigned int PasteFlag; - WORD UTF8Fallback; + WORD FallbackToCP932; WORD DisableAcceleratorSendBreak; int EnableClickableUrl; eterm_lookfeel_t EtermLookfeel; Modified: trunk/teraterm/teraterm/charset.cpp =================================================================== --- trunk/teraterm/teraterm/charset.cpp 2023-07-07 16:09:54 UTC (rev 10800) +++ trunk/teraterm/teraterm/charset.cpp 2023-07-07 16:10:06 UTC (rev 10801) @@ -210,7 +210,7 @@ w->ConvJIS = FALSE; if (ts.KanjiCode==IdSJIS || - (ts.UTF8Fallback && ts.KanjiCode==IdUTF8)) { + (ts.FallbackToCP932 && ts.KanjiCode==IdUTF8)) { if (((0x80<b) && (b<0xa0)) || ((0xdf<b) && (b<0xfd))) { w->Fallbacked = TRUE; return TRUE; // SJIS kanji @@ -637,7 +637,7 @@ // 0x80 - 0xc1, 0xf5 - 0xff // UTF-8\x82\xC51byte\x82ɏo\x8C\xBB\x82\xB5\x82Ȃ\xA2\x83R\x81[\x83h\x82̂Ƃ\xAB - if (ts.UTF8Fallback) { + if (ts.FallbackToCP932) { // fallback\x82\xB7\x82\xE9\x8Fꍇ if ((ts.Language == IdJapanese) && ismbbleadSJIS(b)) { // \x93\xFA\x96{\x8C\xEA\x82̏ꍇ && Shift_JIS 1byte\x96\xDA @@ -648,15 +648,10 @@ w->KanjiIn = TRUE; return TRUE; } - // fallback ISO8859-1 - w->Op.PutU32(b, w->ClientData); - return TRUE; } - else { - // fallback\x82\xB5\x82Ȃ\xA2, \x95s\x90\xB3\x82ȕ\xB6\x8E\x9A\x93\xFC\x97\xCD - w->buf[0] = b; - PutReplacementChr(w, w->buf, 1, FALSE); - } + // fallback\x82\xB5\x82Ȃ\xA2, \x95s\x90\xB3\x82ȕ\xB6\x8E\x9A\x93\xFC\x97\xCD + w->buf[0] = b; + PutReplacementChr(w, w->buf, 1, FALSE); return TRUE; } @@ -663,7 +658,7 @@ // 2byte\x88ȍ~\x90\xB3\x8F\xED? if((b & 0xc0) != 0x80) { // == (b <= 0x7f || 0xc0 <= b) // \x95s\x90\xB3\x82ȕ\xB6\x8E\x9A, (\x8F\xE3\x88\xCA2bit\x82\xAA 0b10xx_xxxx \x82ł͂Ȃ\xA2) - PutReplacementChr(w, w->buf, w->count, ts.UTF8Fallback); + PutReplacementChr(w, w->buf, w->count, ts.FallbackToCP932); w->count = 0; goto recheck; } @@ -696,7 +691,7 @@ if ((w->buf[0] == 0xe0 && (w->buf[1] < 0xa0 || 0xbf < w->buf[1])) || (w->buf[0] == 0xed && ( 0x9f < w->buf[1]))) { // \x95s\x90\xB3\x82\xC8 UTF-8 - PutReplacementChr(w, w->buf, 2, ts.UTF8Fallback); + PutReplacementChr(w, w->buf, 2, ts.FallbackToCP932); w->count = 0; goto recheck; } @@ -717,7 +712,7 @@ if ((w->buf[0] == 0xf0 && (w->buf[1] < 0x90 || 0x9f < w->buf[1])) || (w->buf[0] == 0xf4 && (w->buf[1] < 0x80 || 0x8f < w->buf[1]))) { // \x95s\x90\xB3\x82\xC8 UTF-8 - PutReplacementChr(w, w->buf, 3, ts.UTF8Fallback); + PutReplacementChr(w, w->buf, 3, ts.FallbackToCP932); w->count = 0; goto recheck; } Modified: trunk/teraterm/ttpset/ttset.c =================================================================== --- trunk/teraterm/ttpset/ttset.c 2023-07-07 16:09:54 UTC (rev 10800) +++ trunk/teraterm/ttpset/ttset.c 2023-07-07 16:10:06 UTC (rev 10801) @@ -2049,9 +2049,8 @@ ts->SelectStartDelay = GetPrivateProfileInt(Section, "MouseSelectStartDelay", 0, FName); - // UTF8 Fallback (Experimental) - ts->UTF8Fallback = GetOnOff(Section, "FallbackToCP932", FName, FALSE); - ts->UTF8Fallback = GetOnOff(Section, "UTF8Fallback", FName, ts->UTF8Fallback); + // Fallback CP932 (Experimental) + ts->FallbackToCP932 = GetOnOff(Section, "FallbackToCP932", FName, FALSE); // dialog font ReadFont3(L"Tera Term", L"DlgFont", NULL, FName, @@ -3282,6 +3281,9 @@ // Delay for start of mouse selection WriteInt(Section, "MouseSelectStartDelay", FName, ts->SelectStartDelay); + // Fallback CP932 (Experimental) + WriteOnOff(Section, "FallbackToCP932", FName, ts->FallbackToCP932); + // dialog font aswprintf(&TempW, L"%s,%d,%d", ts->DialogFontNameW, ts->DialogFontPoint, ts->DialogFontCharSet); WritePrivateProfileStringW(L"Tera Term", L"DlgFont", TempW, FName);