Skip to content

Commit

Permalink
Language設定がなくなったので関連個所を修正 #306
Browse files Browse the repository at this point in the history
- ドキュメントに反映した
- 文字コードにUTF-8を選択時、ambiguous, emoji 文字幅のデフォルトを適宜設定するようにした
  - Windowsの設定がCJKのとき、2cell
  - 以外は 1cell
- TTX KanjiMenu 起動時にWindowsの設定が韓国語の場合は韓国語モードをデフォルトにした
  - それ以外は 日本語モードがデフォルト
  • Loading branch information
zmatsuo committed Sep 11, 2024
1 parent b86f0f6 commit 80aa0ad
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 52 deletions.
8 changes: 7 additions & 1 deletion TTXKanjiMenu/ttxkanjimenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,13 @@ BOOL WINAPI DllMain(HANDLE hInstance,
/* do process initialization */
hInst = hInstance;
pvar = &InstVar;
pvar->language = MENU_JAPANESE;
if (GetACP() == 949) {
// CP949 = Korean
pvar->language = MENU_KOREAN;
}
else {
pvar->language = MENU_JAPANESE;
}
break;
case DLL_PROCESS_DETACH:
/* do process cleanup */
Expand Down
11 changes: 8 additions & 3 deletions doc/en/html/about/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ <h3 id="teraterm_5.4">YYYY.MM.DD (Ver 5.4 not released yet)</h3>
</ul>
</li-->

<!--li>Misc
<li>Misc
<ul>
<li>Upgraded TTSSH to <a href="#ttssh_3.4">3.4</a>.</li>
<li>Upgraded TTX KanjiMenu Plug-in to <a href="#kanjimenu_0.1.10">0.1.10</a></li>
</ul>
</li-->
</li>
</ul>

<h3 id="teraterm_5.3">2024.09.08 (Ver 5.3)</h3>
Expand Down Expand Up @@ -5631,6 +5631,11 @@ <h3 id="ttmenu_0.94r2">2004.12.8 (Ver 0.94r2)</h3>

<h2 id="kanjimenu">TTX KanjiMenu</h2>

<h3 id="kanjimenu_0.1.10">YYYY.MM.DD (Ver 0.1.10)</h3>
<ul class="history">
<li>Japanese mode and Korean mode can be changed at any time.</li>
</ul>

<h3 id="kanjimenu_0.1.9">2024.9.6 (Ver 0.1.9)</h3>
<ul class="history">
<li>Refactoring for menu creation.</li>
Expand Down
22 changes: 0 additions & 22 deletions doc/en/html/usage/unicode.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,6 @@ <h1>Unicode Settings</h1>
<dd>
</dl>

<h2>TTXKanjiMenu plug-in</h2>

TTXKanjiMenu plug-in is available only for the following character encodings.
It is not displayed for other character codes.

<ul>
<li>"Japanese/UTF-8"</li>
<li>"Japanese/SJIS (CP932)"</li>
<li>"Japanese/JIS"</li>
<li>"Japanese/EUC"</li>
<li>"Korean/KS5601 (CP949)"</li>
<li>"Korean/UTF-8"</li>
</ul>

<h2>Language</h2>

String from the beginning of the character code to "/" (eg. "Japanese") corresponds to "Language"
that was existed in "Setup" menu - "General" dialog In Tera Term 5.2 or earlier.

<p>
Tera Term has a restriction that sending and receiving character codes must be selected same language.

<h2>command line</h2>

When "UTF8" is specified with '/KT' or '/KR' option in the command line,
Expand Down
11 changes: 8 additions & 3 deletions doc/ja/html/about/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ <h3 id="teraterm_5.4">YYYY.MM.DD (Ver 5.4 not released yet)</h3>
</ul>
</li-->

<!--li>その他
<li>その他
<ul>
<li><a href="#ttssh_3.4">TTSSH(3.4)</a>へ差し替えた。</li>
<li><a href="#kanjimenu_0.1.10">TTX KanjiMenu Plugin(0.1.10)</a>へ差し替えた。</li>
</ul>
</li-->

</ul>

<h3 id="teraterm_5.3">2024.09.08 (Ver 5.3)</h3>
Expand Down Expand Up @@ -5641,6 +5641,11 @@ <h3 id="ttmenu_0.94r2">2004.12.8 (Ver 0.94r2)</h3>

<h2 id="kanjimenu">TTX KanjiMenu</h2>

<h3 id="kanjimenu_0.1.10">YYYY.MM.DD (Ver 0.1.10)</h3>
<ul class="history">
<li>日本語モードと韓国語モードをいつでも変更できるようにした。</li>
</ul>

<h3 id="kanjimenu_0.1.9">2024.9.6 (Ver 0.1.9)</h3>
<ul class="history">
<li>メニューの作成部分のコードを見直した。</li>
Expand Down
21 changes: 0 additions & 21 deletions doc/ja/html/usage/unicode.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,6 @@
<dd>
</dl>

<h2>TTXKanjiMenuプラグイン</h2>

次の文字コードの時のみ使用できます。他の文字コードの時は表示されません。

<ul>
<li>"Japanese/UTF-8"</li>
<li>"Japanese/SJIS (CP932)"</li>
<li>"Japanese/JIS"</li>
<li>"Japanese/EUC"</li>
<li>"Korean/KS5601 (CP949)"</li>
<li>"Korean/UTF-8"</li>
</ul>

<h2>Language</h2>

各文字コード文字列の先頭から"/"の文字(例 "Japanese")が、Tera Term 5.2 まで存在していた
「Setup[設定]」メニュー「General[全般]」の「Language[言語]」相当になります。

<p>
Tera Term には、送信文字と受信文字コードは同一の言語から選択しなければならない制限があります。

<h2>コマンドライン</h2>

コマンドラインの「/KT」および「/KR」オプションにおいて、"UTF8" を指定すると、
Expand Down
10 changes: 8 additions & 2 deletions teraterm/teraterm/coding_pp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ static void ArrenageItems(HWND hWnd)
else {
EnableWindows(hWnd, UnicodeItems, _countof(UnicodeItems), FALSE);
}
if (LangIsJapanese(coding_send) || coding_send == IdKoreanCP949 || coding_send == IdCnGB2312 || coding_send == IdCnBig5) {
const int code_page = GetACP();
if ((coding_send == IdUTF8 &&
(code_page == 932 || code_page == 949 || code_page == 936 || code_page == 950)) ||
coding_send == IdSJIS || coding_send == IdEUC || coding_send == IdJIS ||
coding_send == IdKoreanCP949 || coding_send == IdCnGB2312 || coding_send == IdCnBig5) {
// UTF-8 で CJK(CP932, CP949, CP936, CP950) のとき
// or DBCS(Unicodeではないので選択できない)のとき
SendDlgItemMessage(hWnd, IDC_AMBIGUOUS_WIDTH_COMBO, CB_SETCURSEL, 1, 0);
CheckDlgButton(hWnd, IDC_EMOJI_WIDTH_CHECK, BST_CHECKED);
SendDlgItemMessage(hWnd, IDC_EMOJI_WIDTH_COMBO, CB_SETCURSEL, 1, 0);
Expand Down Expand Up @@ -234,7 +240,7 @@ static INT_PTR CALLBACK Proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)

ArrenageItems(hWnd);

// character width
// character width (現在の値)
SetDropDownList(hWnd, IDC_AMBIGUOUS_WIDTH_COMBO, CellWidthList, ts->UnicodeAmbiguousWidth == 1 ? 1 : 2);
CheckDlgButton(hWnd, IDC_EMOJI_WIDTH_CHECK, ts->UnicodeEmojiOverride ? BST_CHECKED : BST_UNCHECKED);
SetDropDownList(hWnd, IDC_EMOJI_WIDTH_COMBO, CellWidthList, ts->UnicodeEmojiWidth == 1 ? 1 : 2);
Expand Down

0 comments on commit 80aa0ad

Please sign in to comment.