FFFTPのソースコードです。
Revision | 25262d6da000ac0d10f84c5aa75e33166f9fa05b (tree) |
---|---|
Time | 2011-11-05 16:47:43 |
Author | s_kawamoto <s_kawamoto@user...> |
Commiter | s_kawamoto |
Add support for UTF-8 without BOM under ASCII mode transfer.
Change size and layout of the window.
@@ -726,13 +726,14 @@ hset_code_dlg DIALOGEX 0, 0, 207, 139 | ||
726 | 726 | STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION |
727 | 727 | FONT 9, "MS Pゴシック", 0, 0, 0x0 |
728 | 728 | BEGIN |
729 | - GROUPBOX "ホストの漢字コード(&K)",-1,7,7,98,94,WS_GROUP | |
729 | + GROUPBOX "ホストの漢字コード(&K)",-1,7,7,98,106,WS_GROUP | |
730 | 730 | CONTROL "無変換",HSET_NO_CNV,"Button",BS_AUTORADIOBUTTON | WS_GROUP,12,21,81,10 |
731 | 731 | CONTROL "Shift_JIS",HSET_SJIS_CNV,"Button",BS_AUTORADIOBUTTON,12,33,81,10 |
732 | 732 | CONTROL "JIS",HSET_JIS_CNV,"Button",BS_AUTORADIOBUTTON,12,45,41,10 |
733 | 733 | CONTROL "EUC",HSET_EUC_CNV,"Button",BS_AUTORADIOBUTTON,12,57,41,10 |
734 | 734 | CONTROL "UTF-8",HSET_UTF8N_CNV,"Button",BS_AUTORADIOBUTTON,12,69,41,10 |
735 | - CONTROL "半角カナを全角に変換",HSET_HANCNV,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,12,86,87,10 | |
735 | + CONTROL "UTF-8 BOM",HSET_UTF8BOM_CNV,"Button",BS_AUTORADIOBUTTON,12,81,81,10 | |
736 | + CONTROL "半角カナを全角に変換",HSET_HANCNV,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,12,98,87,10 | |
736 | 737 | GROUPBOX "ファイル名の漢字コード(&N)",-1,110,7,90,115,WS_GROUP |
737 | 738 | CONTROL "自動",HSET_FN_AUTO_CNV,"Button",BS_AUTORADIOBUTTON | WS_GROUP,114,21,65,10 |
738 | 739 | CONTROL "Shift_JIS",HSET_FN_SJIS_CNV,"Button",BS_AUTORADIOBUTTON,114,33,65,10 |
@@ -2121,6 +2122,7 @@ BEGIN | ||
2121 | 2122 | BUTTON ID_BUTTON40156 |
2122 | 2123 | BUTTON ID_BUTTON40173 |
2123 | 2124 | BUTTON ID_BUTTON40174 |
2125 | + BUTTON ID_BUTTON40175 | |
2124 | 2126 | END |
2125 | 2127 | |
2126 | 2128 | remote_toolbar_bmp TOOLBAR 16, 16 |
@@ -429,6 +429,7 @@ | ||
429 | 429 | #define HSET_PRIVATE_KEY 1203 |
430 | 430 | #define HSET_THREAD_COUNT 1204 |
431 | 431 | #define HSET_THREAD_COUNT_SPN 1205 |
432 | +#define HSET_UTF8BOM_CNV 1206 | |
432 | 433 | #define MENU_END 40001 |
433 | 434 | #define MENU_EXIT 40001 |
434 | 435 | #define MENU_CONNECT 40003 |
@@ -484,21 +485,21 @@ | ||
484 | 485 | #define MENU_KNJ_EUC 40044 |
485 | 486 | #define MENU_KNJ_JIS 40045 |
486 | 487 | #define MENU_KNJ_UTF8N 40046 |
487 | -#define MENU_KNJ_NONE 40047 | |
488 | -#define MENU_L_KNJ_SJIS 40048 | |
489 | -#define MENU_L_KNJ_EUC 40049 | |
490 | -#define MENU_L_KNJ_JIS 40050 | |
491 | -#define MENU_L_KNJ_UTF8N 40051 | |
492 | -#define MENU_UPDIR 40052 | |
493 | -#define MENU_DCLICK 40053 | |
494 | -#define MENU_SELECT 40054 | |
495 | -#define MENU_SELECT_ALL 40055 | |
496 | -#define MENU_FIND 40056 | |
497 | -#define MENU_FINDNEXT 40057 | |
498 | -#define MENU_DOTFILE 40058 | |
499 | -#define MENU_IMPORT_WS 40059 | |
500 | -#define ID_BUTTON40060 40060 | |
501 | -#define ID_BUTTON40061 40061 | |
488 | +#define MENU_KNJ_UTF8BOM 40047 | |
489 | +#define MENU_KNJ_NONE 40048 | |
490 | +#define MENU_L_KNJ_SJIS 40049 | |
491 | +#define MENU_L_KNJ_EUC 40050 | |
492 | +#define MENU_L_KNJ_JIS 40051 | |
493 | +#define MENU_L_KNJ_UTF8N 40052 | |
494 | +#define MENU_L_KNJ_UTF8BOM 40053 | |
495 | +#define MENU_UPDIR 40054 | |
496 | +#define MENU_DCLICK 40055 | |
497 | +#define MENU_SELECT 40056 | |
498 | +#define MENU_SELECT_ALL 40057 | |
499 | +#define MENU_FIND 40058 | |
500 | +#define MENU_FINDNEXT 40059 | |
501 | +#define MENU_DOTFILE 40060 | |
502 | +#define MENU_IMPORT_WS 40061 | |
502 | 503 | #define ID_BUTTON40062 40062 |
503 | 504 | #define ID_BUTTON40063 40063 |
504 | 505 | #define ID_BUTTON40064 40064 |
@@ -605,6 +606,7 @@ | ||
605 | 606 | #define MENU_CHANGEPASSWD 40172 |
606 | 607 | #define ID_BUTTON40173 40173 |
607 | 608 | #define ID_BUTTON40174 40174 |
609 | +#define ID_BUTTON40175 40175 | |
608 | 610 | #define FSNOTIFY_TITLE 65535 |
609 | 611 | #define HOST_SIZEGRIP 65535 |
610 | 612 |
@@ -613,8 +615,8 @@ | ||
613 | 615 | #ifdef APSTUDIO_INVOKED |
614 | 616 | #ifndef APSTUDIO_READONLY_SYMBOLS |
615 | 617 | #define _APS_NEXT_RESOURCE_VALUE 191 |
616 | -#define _APS_NEXT_COMMAND_VALUE 40175 | |
617 | -#define _APS_NEXT_CONTROL_VALUE 1206 | |
618 | +#define _APS_NEXT_COMMAND_VALUE 40176 | |
619 | +#define _APS_NEXT_CONTROL_VALUE 1207 | |
618 | 620 | #define _APS_NEXT_SYMED_VALUE 101 |
619 | 621 | #endif |
620 | 622 | #endif |
@@ -733,13 +733,14 @@ hset_code_dlg DIALOGEX 0, 0, 207, 139 | ||
733 | 733 | STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION |
734 | 734 | FONT 9, "MS Sans Serif", 0, 0, 0x0 |
735 | 735 | BEGIN |
736 | - GROUPBOX "&Japanese Kanji Code",-1,7,7,98,94,WS_GROUP | |
736 | + GROUPBOX "&Japanese Kanji Code",-1,7,7,98,106,WS_GROUP | |
737 | 737 | CONTROL "No conversion",HSET_NO_CNV,"Button",BS_AUTORADIOBUTTON | WS_GROUP,12,21,91,10 |
738 | 738 | CONTROL "Shift_JIS",HSET_SJIS_CNV,"Button",BS_AUTORADIOBUTTON,12,33,81,10 |
739 | 739 | CONTROL "JIS",HSET_JIS_CNV,"Button",BS_AUTORADIOBUTTON,12,45,41,10 |
740 | 740 | CONTROL "EUC",HSET_EUC_CNV,"Button",BS_AUTORADIOBUTTON,12,57,41,10 |
741 | 741 | CONTROL "UTF-8",HSET_UTF8N_CNV,"Button",BS_AUTORADIOBUTTON,12,69,41,10 |
742 | - CONTROL "Hankaku to Zenkaku",HSET_HANCNV,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,12,96,90,10 | |
742 | + CONTROL "UTF-8 BOM",HSET_UTF8BOM_CNV,"Button",BS_AUTORADIOBUTTON,12,81,81,10 | |
743 | + CONTROL "Hankaku to Zenkaku",HSET_HANCNV,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,12,98,90,10 | |
743 | 744 | GROUPBOX "&Filename Kanji Code",-1,107,7,97,116,WS_GROUP |
744 | 745 | CONTROL "Automatic",HSET_FN_AUTO_CNV,"Button",BS_AUTORADIOBUTTON | WS_GROUP,111,21,65,10 |
745 | 746 | CONTROL "Shift_JIS",HSET_FN_SJIS_CNV,"Button",BS_AUTORADIOBUTTON,111,33,65,10 |
@@ -1371,7 +1372,8 @@ hset_crypt_dlg DIALOG 0, 0, 207, 139 | ||
1371 | 1372 | STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION |
1372 | 1373 | FONT 9, "MS Sans Serif" |
1373 | 1374 | BEGIN |
1374 | - CONTROL "Allow to connect without encryption",HSET_NO_ENCRYPTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,148,10 | |
1375 | + CONTROL "Allow to connect without encryption",HSET_NO_ENCRYPTION, | |
1376 | + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,148,10 | |
1375 | 1377 | CONTROL "Connect with FTPS (Explicit)",HSET_FTPES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,21,148,10 |
1376 | 1378 | CONTROL "Connect with FTPS (Implicit)",HSET_FTPIS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,35,148,10 |
1377 | 1379 | CONTROL "Connect with SFTP",HSET_SFTP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 |
@@ -2143,6 +2145,7 @@ BEGIN | ||
2143 | 2145 | BUTTON ID_BUTTON40156 |
2144 | 2146 | BUTTON ID_BUTTON40173 |
2145 | 2147 | BUTTON ID_BUTTON40174 |
2148 | + BUTTON ID_BUTTON40175 | |
2146 | 2149 | END |
2147 | 2150 | |
2148 | 2151 | remote_toolbar_bmp TOOLBAR 16, 16 |
@@ -429,6 +429,7 @@ | ||
429 | 429 | #define HSET_PRIVATE_KEY 1203 |
430 | 430 | #define HSET_THREAD_COUNT 1204 |
431 | 431 | #define HSET_THREAD_COUNT_SPN 1205 |
432 | +#define HSET_UTF8BOM_CNV 1206 | |
432 | 433 | #define MENU_END 40001 |
433 | 434 | #define MENU_EXIT 40001 |
434 | 435 | #define MENU_CONNECT 40003 |
@@ -484,21 +485,21 @@ | ||
484 | 485 | #define MENU_KNJ_EUC 40044 |
485 | 486 | #define MENU_KNJ_JIS 40045 |
486 | 487 | #define MENU_KNJ_UTF8N 40046 |
487 | -#define MENU_KNJ_NONE 40047 | |
488 | -#define MENU_L_KNJ_SJIS 40048 | |
489 | -#define MENU_L_KNJ_EUC 40049 | |
490 | -#define MENU_L_KNJ_JIS 40050 | |
491 | -#define MENU_L_KNJ_UTF8N 40051 | |
492 | -#define MENU_UPDIR 40052 | |
493 | -#define MENU_DCLICK 40053 | |
494 | -#define MENU_SELECT 40054 | |
495 | -#define MENU_SELECT_ALL 40055 | |
496 | -#define MENU_FIND 40056 | |
497 | -#define MENU_FINDNEXT 40057 | |
498 | -#define MENU_DOTFILE 40058 | |
499 | -#define MENU_IMPORT_WS 40059 | |
500 | -#define ID_BUTTON40060 40060 | |
501 | -#define ID_BUTTON40061 40061 | |
488 | +#define MENU_KNJ_UTF8BOM 40047 | |
489 | +#define MENU_KNJ_NONE 40048 | |
490 | +#define MENU_L_KNJ_SJIS 40049 | |
491 | +#define MENU_L_KNJ_EUC 40050 | |
492 | +#define MENU_L_KNJ_JIS 40051 | |
493 | +#define MENU_L_KNJ_UTF8N 40052 | |
494 | +#define MENU_L_KNJ_UTF8BOM 40053 | |
495 | +#define MENU_UPDIR 40054 | |
496 | +#define MENU_DCLICK 40055 | |
497 | +#define MENU_SELECT 40056 | |
498 | +#define MENU_SELECT_ALL 40057 | |
499 | +#define MENU_FIND 40058 | |
500 | +#define MENU_FINDNEXT 40059 | |
501 | +#define MENU_DOTFILE 40060 | |
502 | +#define MENU_IMPORT_WS 40061 | |
502 | 503 | #define ID_BUTTON40062 40062 |
503 | 504 | #define ID_BUTTON40063 40063 |
504 | 505 | #define ID_BUTTON40064 40064 |
@@ -605,6 +606,7 @@ | ||
605 | 606 | #define MENU_CHANGEPASSWD 40172 |
606 | 607 | #define ID_BUTTON40173 40173 |
607 | 608 | #define ID_BUTTON40174 40174 |
609 | +#define ID_BUTTON40175 40175 | |
608 | 610 | #define FSNOTIFY_TITLE 65535 |
609 | 611 | #define HOST_SIZEGRIP 65535 |
610 | 612 |
@@ -613,8 +615,8 @@ | ||
613 | 615 | #ifdef APSTUDIO_INVOKED |
614 | 616 | #ifndef APSTUDIO_READONLY_SYMBOLS |
615 | 617 | #define _APS_NEXT_RESOURCE_VALUE 191 |
616 | -#define _APS_NEXT_COMMAND_VALUE 40175 | |
617 | -#define _APS_NEXT_CONTROL_VALUE 1206 | |
618 | +#define _APS_NEXT_COMMAND_VALUE 40176 | |
619 | +#define _APS_NEXT_CONTROL_VALUE 1207 | |
618 | 620 | #define _APS_NEXT_SYMED_VALUE 101 |
619 | 621 | #endif |
620 | 622 | #endif |
@@ -687,9 +687,12 @@ LIST_UNIX_70 | ||
687 | 687 | #define KANJI_SMB_HEX 3 /* Samba-HEX */ |
688 | 688 | #define KANJI_SMB_CAP 4 /* Samba-CAP */ |
689 | 689 | #define KANJI_UTF8N 5 /* UTF-8 */ |
690 | +// UTF-8対応 | |
691 | +#define KANJI_UTF8BOM 6 /* UTF-8 BOM */ | |
690 | 692 | |
691 | 693 | #define KANJI_NOCNV -1 /* 漢字コード変換なし */ |
692 | 694 | |
695 | +// UTF-8対応 | |
693 | 696 | #define KANJI_AUTO -1 |
694 | 697 | |
695 | 698 | /*===== サウンド =====*/ |
@@ -49,6 +49,11 @@ Changes in Ver.1.98c | ||
49 | 49 | -- Fixed bugs of handling multi-byte character filenames on hosts whose Kanji |
50 | 50 | code of filenames are Shift_JIS. |
51 | 51 | |
52 | +-- Added support for UTF-8 (without BOM) conversion under ASCII mode transfer. | |
53 | + UTF-8 added in 1.98 was renamed UTF-8 BOM. | |
54 | + | |
55 | +-- Changed size and layout of the window at the first run. | |
56 | + | |
52 | 57 | |
53 | 58 | Outline |
54 | 59 | ------- |
@@ -21,6 +21,11 @@ Changes in Ver.1.98c | ||
21 | 21 | -- Fixed bugs of handling multi-byte character filenames on hosts whose Kanji |
22 | 22 | code of filenames are Shift_JIS. |
23 | 23 | |
24 | +-- Added support for UTF-8 (without BOM) conversion under ASCII mode transfer. | |
25 | + UTF-8 added in 1.98 was renamed UTF-8 BOM. | |
26 | + | |
27 | +-- Changed size and layout of the window at the first run. | |
28 | + | |
24 | 29 | Changes in Ver.1.98b |
25 | 30 | -------------------- |
26 | 31 |
@@ -52,6 +52,13 @@ Ver 1.98c | ||
52 | 52 | ・ホストのファイル名の漢字コードがShift_JISの場合に一部日本語を含む |
53 | 53 | ファイル名を扱えないバグを修正しました。 |
54 | 54 | |
55 | +・アスキーモード転送の際に行われる漢字コード変換で新たにUTF-8 | |
56 | + (BOMなし)への変換をサポートしました。1.98で追加されたUTF-8を | |
57 | + UTF-8 BOMという名称に変更しました。 | |
58 | + | |
59 | +・初回起動時のウィンドウのサイズとレイアウトを変更しました(以前の | |
60 | + バージョンの設定が残っている場合はその設定が適用されます)。 | |
61 | + | |
55 | 62 | |
56 | 63 | Ver 1.96d以前へ戻す場合 |
57 | 64 | ----------------------- |
@@ -24,6 +24,13 @@ FFFTP | ||
24 | 24 | ・ホストのファイル名の漢字コードがShift_JISの場合に一部日本語を含む |
25 | 25 | ファイル名を扱えないバグを修正しました。 |
26 | 26 | |
27 | +・アスキーモード転送の際に行われる漢字コード変換で新たにUTF-8 | |
28 | + (BOMなし)への変換をサポートしました。1.98で追加されたUTF-8を | |
29 | + UTF-8 BOMという名称に変更しました。 | |
30 | + | |
31 | +・初回起動時のウィンドウのサイズとレイアウトを変更しました(以前の | |
32 | + バージョンの設定が残っている場合はその設定が適用されます)。 | |
33 | + | |
27 | 34 | ■Ver 1.98b |
28 | 35 | |
29 | 36 | ・信頼できないDLLの読み込みを防ぐ機能を追加しました。Microsoftの署名が |
@@ -1635,6 +1635,11 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1635 | 1635 | cInfo2.OutLen = cInfo.OutLen; |
1636 | 1636 | break; |
1637 | 1637 | case KANJI_UTF8N: |
1638 | + Continue = ConvSJIStoUTF8N(&cInfo); | |
1639 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1640 | + cInfo2.OutLen = cInfo.OutLen; | |
1641 | + break; | |
1642 | + case KANJI_UTF8BOM: | |
1638 | 1643 | if(ProcessedBOM == NO) |
1639 | 1644 | { |
1640 | 1645 | memcpy(Buf3, "\xEF\xBB\xBF", 3); |
@@ -1678,6 +1683,14 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1678 | 1683 | ConvSJIStoEUC(&cInfo2); |
1679 | 1684 | break; |
1680 | 1685 | case KANJI_UTF8N: |
1686 | + Continue = ConvJIStoSJIS(&cInfo); | |
1687 | + cInfo2.Str = cInfo.Buf; | |
1688 | + cInfo2.StrLen = cInfo.OutLen; | |
1689 | + cInfo2.Buf = Buf3; | |
1690 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1691 | + ConvSJIStoUTF8N(&cInfo2); | |
1692 | + break; | |
1693 | + case KANJI_UTF8BOM: | |
1681 | 1694 | if(ProcessedBOM == NO) |
1682 | 1695 | { |
1683 | 1696 | memcpy(Buf3, "\xEF\xBB\xBF", 3); |
@@ -1724,6 +1737,14 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1724 | 1737 | ConvSJIStoEUC(&cInfo2); |
1725 | 1738 | break; |
1726 | 1739 | case KANJI_UTF8N: |
1740 | + Continue = ConvEUCtoSJIS(&cInfo); | |
1741 | + cInfo2.Str = cInfo.Buf; | |
1742 | + cInfo2.StrLen = cInfo.OutLen; | |
1743 | + cInfo2.Buf = Buf3; | |
1744 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1745 | + ConvSJIStoUTF8N(&cInfo2); | |
1746 | + break; | |
1747 | + case KANJI_UTF8BOM: | |
1727 | 1748 | if(ProcessedBOM == NO) |
1728 | 1749 | { |
1729 | 1750 | memcpy(Buf3, "\xEF\xBB\xBF", 3); |
@@ -1742,6 +1763,50 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1742 | 1763 | } |
1743 | 1764 | break; |
1744 | 1765 | case KANJI_UTF8N: |
1766 | + switch(Pkt->KanjiCodeDesired) | |
1767 | + { | |
1768 | + case KANJI_SJIS: | |
1769 | + Continue = ConvUTF8NtoSJIS(&cInfo); | |
1770 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1771 | + cInfo2.OutLen = cInfo.OutLen; | |
1772 | + break; | |
1773 | + case KANJI_JIS: | |
1774 | + Continue = ConvUTF8NtoSJIS(&cInfo); | |
1775 | + cInfo2.Str = cInfo.Buf; | |
1776 | + cInfo2.StrLen = cInfo.OutLen; | |
1777 | + cInfo2.Buf = Buf3; | |
1778 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1779 | + ConvSJIStoJIS(&cInfo2); | |
1780 | + break; | |
1781 | + case KANJI_EUC: | |
1782 | + Continue = ConvUTF8NtoSJIS(&cInfo); | |
1783 | + cInfo2.Str = cInfo.Buf; | |
1784 | + cInfo2.StrLen = cInfo.OutLen; | |
1785 | + cInfo2.Buf = Buf3; | |
1786 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1787 | + ConvSJIStoEUC(&cInfo2); | |
1788 | + break; | |
1789 | + case KANJI_UTF8N: | |
1790 | + memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
1791 | + cInfo2.OutLen = cInfo.StrLen; | |
1792 | + Continue = NO; | |
1793 | + break; | |
1794 | + case KANJI_UTF8BOM: | |
1795 | + if(ProcessedBOM == NO) | |
1796 | + { | |
1797 | + memcpy(Buf3, "\xEF\xBB\xBF", 3); | |
1798 | + cInfo2.OutLen = 3; | |
1799 | + Continue = YES; | |
1800 | + ProcessedBOM = YES; | |
1801 | + break; | |
1802 | + } | |
1803 | + memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
1804 | + cInfo2.OutLen = cInfo.StrLen; | |
1805 | + Continue = NO; | |
1806 | + break; | |
1807 | + } | |
1808 | + break; | |
1809 | + case KANJI_UTF8BOM: | |
1745 | 1810 | if(ProcessedBOM == NO) |
1746 | 1811 | { |
1747 | 1812 | if(memcmp(Buf, "\xEF\xBB\xBF", 3) == 0) |
@@ -1752,7 +1817,7 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1752 | 1817 | cInfo2.OutLen = 0; |
1753 | 1818 | switch(Pkt->KanjiCodeDesired) |
1754 | 1819 | { |
1755 | - case KANJI_UTF8N: | |
1820 | + case KANJI_UTF8BOM: | |
1756 | 1821 | memcpy(Buf3, "\xEF\xBB\xBF", 3); |
1757 | 1822 | cInfo2.OutLen = 3; |
1758 | 1823 | break; |
@@ -1789,6 +1854,11 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1789 | 1854 | cInfo2.OutLen = cInfo.StrLen; |
1790 | 1855 | Continue = NO; |
1791 | 1856 | break; |
1857 | + case KANJI_UTF8BOM: | |
1858 | + memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
1859 | + cInfo2.OutLen = cInfo.StrLen; | |
1860 | + Continue = NO; | |
1861 | + break; | |
1792 | 1862 | } |
1793 | 1863 | break; |
1794 | 1864 | } |
@@ -1850,6 +1920,10 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1850 | 1920 | memcpy(Buf3, cInfo.Buf, cInfo.OutLen); |
1851 | 1921 | cInfo2.OutLen = cInfo.OutLen; |
1852 | 1922 | break; |
1923 | + case KANJI_UTF8BOM: | |
1924 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1925 | + cInfo2.OutLen = cInfo.OutLen; | |
1926 | + break; | |
1853 | 1927 | } |
1854 | 1928 | break; |
1855 | 1929 | case KANJI_JIS: |
@@ -1881,6 +1955,13 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1881 | 1955 | cInfo2.BufSize = (BUFSIZE + 3) * 4; |
1882 | 1956 | ConvSJIStoUTF8N(&cInfo2); |
1883 | 1957 | break; |
1958 | + case KANJI_UTF8BOM: | |
1959 | + cInfo2.Str = cInfo.Buf; | |
1960 | + cInfo2.StrLen = cInfo.OutLen; | |
1961 | + cInfo2.Buf = Buf3; | |
1962 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1963 | + ConvSJIStoUTF8N(&cInfo2); | |
1964 | + break; | |
1884 | 1965 | } |
1885 | 1966 | break; |
1886 | 1967 | case KANJI_EUC: |
@@ -1912,6 +1993,13 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1912 | 1993 | cInfo2.BufSize = (BUFSIZE + 3) * 4; |
1913 | 1994 | ConvSJIStoUTF8N(&cInfo2); |
1914 | 1995 | break; |
1996 | + case KANJI_UTF8BOM: | |
1997 | + cInfo2.Str = cInfo.Buf; | |
1998 | + cInfo2.StrLen = cInfo.OutLen; | |
1999 | + cInfo2.Buf = Buf3; | |
2000 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2001 | + ConvSJIStoUTF8N(&cInfo2); | |
2002 | + break; | |
1915 | 2003 | } |
1916 | 2004 | break; |
1917 | 2005 | case KANJI_UTF8N: |
@@ -1939,6 +2027,41 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1939 | 2027 | memcpy(Buf3, cInfo.Buf, cInfo.OutLen); |
1940 | 2028 | cInfo2.OutLen = cInfo.OutLen; |
1941 | 2029 | break; |
2030 | + case KANJI_UTF8BOM: | |
2031 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2032 | + cInfo2.OutLen = cInfo.OutLen; | |
2033 | + break; | |
2034 | + } | |
2035 | + break; | |
2036 | + case KANJI_UTF8BOM: | |
2037 | + switch(Pkt->KanjiCodeDesired) | |
2038 | + { | |
2039 | + case KANJI_SJIS: | |
2040 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2041 | + cInfo2.OutLen = cInfo.OutLen; | |
2042 | + break; | |
2043 | + case KANJI_JIS: | |
2044 | + cInfo2.Str = cInfo.Buf; | |
2045 | + cInfo2.StrLen = cInfo.OutLen; | |
2046 | + cInfo2.Buf = Buf3; | |
2047 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2048 | + ConvSJIStoJIS(&cInfo2); | |
2049 | + break; | |
2050 | + case KANJI_EUC: | |
2051 | + cInfo2.Str = cInfo.Buf; | |
2052 | + cInfo2.StrLen = cInfo.OutLen; | |
2053 | + cInfo2.Buf = Buf3; | |
2054 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2055 | + ConvSJIStoEUC(&cInfo2); | |
2056 | + break; | |
2057 | + case KANJI_UTF8N: | |
2058 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2059 | + cInfo2.OutLen = cInfo.OutLen; | |
2060 | + break; | |
2061 | + case KANJI_UTF8BOM: | |
2062 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2063 | + cInfo2.OutLen = cInfo.OutLen; | |
2064 | + break; | |
1942 | 2065 | } |
1943 | 2066 | break; |
1944 | 2067 | } |
@@ -2647,6 +2770,11 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2647 | 2770 | cInfo2.OutLen = cInfo.OutLen; |
2648 | 2771 | break; |
2649 | 2772 | case KANJI_UTF8N: |
2773 | + Continue = ConvSJIStoUTF8N(&cInfo); | |
2774 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2775 | + cInfo2.OutLen = cInfo.OutLen; | |
2776 | + break; | |
2777 | + case KANJI_UTF8BOM: | |
2650 | 2778 | if(ProcessedBOM == NO) |
2651 | 2779 | { |
2652 | 2780 | memcpy(Buf3, "\xEF\xBB\xBF", 3); |
@@ -2690,6 +2818,14 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2690 | 2818 | ConvSJIStoEUC(&cInfo2); |
2691 | 2819 | break; |
2692 | 2820 | case KANJI_UTF8N: |
2821 | + Continue = ConvJIStoSJIS(&cInfo); | |
2822 | + cInfo2.Str = cInfo.Buf; | |
2823 | + cInfo2.StrLen = cInfo.OutLen; | |
2824 | + cInfo2.Buf = Buf3; | |
2825 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2826 | + ConvSJIStoUTF8N(&cInfo2); | |
2827 | + break; | |
2828 | + case KANJI_UTF8BOM: | |
2693 | 2829 | if(ProcessedBOM == NO) |
2694 | 2830 | { |
2695 | 2831 | memcpy(Buf3, "\xEF\xBB\xBF", 3); |
@@ -2736,6 +2872,14 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2736 | 2872 | ConvSJIStoEUC(&cInfo2); |
2737 | 2873 | break; |
2738 | 2874 | case KANJI_UTF8N: |
2875 | + Continue = ConvEUCtoSJIS(&cInfo); | |
2876 | + cInfo2.Str = cInfo.Buf; | |
2877 | + cInfo2.StrLen = cInfo.OutLen; | |
2878 | + cInfo2.Buf = Buf3; | |
2879 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2880 | + ConvSJIStoUTF8N(&cInfo2); | |
2881 | + break; | |
2882 | + case KANJI_UTF8BOM: | |
2739 | 2883 | if(ProcessedBOM == NO) |
2740 | 2884 | { |
2741 | 2885 | memcpy(Buf3, "\xEF\xBB\xBF", 3); |
@@ -2754,6 +2898,50 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2754 | 2898 | } |
2755 | 2899 | break; |
2756 | 2900 | case KANJI_UTF8N: |
2901 | + switch(Pkt->KanjiCode) | |
2902 | + { | |
2903 | + case KANJI_SJIS: | |
2904 | + Continue = ConvUTF8NtoSJIS(&cInfo); | |
2905 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2906 | + cInfo2.OutLen = cInfo.OutLen; | |
2907 | + break; | |
2908 | + case KANJI_JIS: | |
2909 | + Continue = ConvUTF8NtoSJIS(&cInfo); | |
2910 | + cInfo2.Str = cInfo.Buf; | |
2911 | + cInfo2.StrLen = cInfo.OutLen; | |
2912 | + cInfo2.Buf = Buf3; | |
2913 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2914 | + ConvSJIStoJIS(&cInfo2); | |
2915 | + break; | |
2916 | + case KANJI_EUC: | |
2917 | + Continue = ConvUTF8NtoSJIS(&cInfo); | |
2918 | + cInfo2.Str = cInfo.Buf; | |
2919 | + cInfo2.StrLen = cInfo.OutLen; | |
2920 | + cInfo2.Buf = Buf3; | |
2921 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2922 | + ConvSJIStoEUC(&cInfo2); | |
2923 | + break; | |
2924 | + case KANJI_UTF8N: | |
2925 | + memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
2926 | + cInfo2.OutLen = cInfo.StrLen; | |
2927 | + Continue = NO; | |
2928 | + break; | |
2929 | + case KANJI_UTF8BOM: | |
2930 | + if(ProcessedBOM == NO) | |
2931 | + { | |
2932 | + memcpy(Buf3, "\xEF\xBB\xBF", 3); | |
2933 | + cInfo2.OutLen = 3; | |
2934 | + Continue = YES; | |
2935 | + ProcessedBOM = YES; | |
2936 | + break; | |
2937 | + } | |
2938 | + memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
2939 | + cInfo2.OutLen = cInfo.StrLen; | |
2940 | + Continue = NO; | |
2941 | + break; | |
2942 | + } | |
2943 | + break; | |
2944 | + case KANJI_UTF8BOM: | |
2757 | 2945 | if(ProcessedBOM == NO) |
2758 | 2946 | { |
2759 | 2947 | if(memcmp(Buf, "\xEF\xBB\xBF", 3) == 0) |
@@ -2764,7 +2952,7 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2764 | 2952 | cInfo2.OutLen = 0; |
2765 | 2953 | switch(Pkt->KanjiCode) |
2766 | 2954 | { |
2767 | - case KANJI_UTF8N: | |
2955 | + case KANJI_UTF8BOM: | |
2768 | 2956 | memcpy(Buf3, "\xEF\xBB\xBF", 3); |
2769 | 2957 | cInfo2.OutLen = 3; |
2770 | 2958 | break; |
@@ -2801,6 +2989,11 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2801 | 2989 | cInfo2.OutLen = cInfo.StrLen; |
2802 | 2990 | Continue = NO; |
2803 | 2991 | break; |
2992 | + case KANJI_UTF8BOM: | |
2993 | + memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
2994 | + cInfo2.OutLen = cInfo.StrLen; | |
2995 | + Continue = NO; | |
2996 | + break; | |
2804 | 2997 | } |
2805 | 2998 | break; |
2806 | 2999 | } |
@@ -2868,6 +3061,10 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2868 | 3061 | memcpy(Buf3, cInfo.Buf, cInfo.OutLen); |
2869 | 3062 | cInfo2.OutLen = cInfo.OutLen; |
2870 | 3063 | break; |
3064 | + case KANJI_UTF8BOM: | |
3065 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
3066 | + cInfo2.OutLen = cInfo.OutLen; | |
3067 | + break; | |
2871 | 3068 | } |
2872 | 3069 | break; |
2873 | 3070 | case KANJI_JIS: |
@@ -2899,6 +3096,13 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2899 | 3096 | cInfo2.BufSize = (BUFSIZE + 3) * 4; |
2900 | 3097 | ConvSJIStoUTF8N(&cInfo2); |
2901 | 3098 | break; |
3099 | + case KANJI_UTF8BOM: | |
3100 | + cInfo2.Str = cInfo.Buf; | |
3101 | + cInfo2.StrLen = cInfo.OutLen; | |
3102 | + cInfo2.Buf = Buf3; | |
3103 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
3104 | + ConvSJIStoUTF8N(&cInfo2); | |
3105 | + break; | |
2902 | 3106 | } |
2903 | 3107 | break; |
2904 | 3108 | case KANJI_EUC: |
@@ -2930,6 +3134,13 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2930 | 3134 | cInfo2.BufSize = (BUFSIZE + 3) * 4; |
2931 | 3135 | ConvSJIStoUTF8N(&cInfo2); |
2932 | 3136 | break; |
3137 | + case KANJI_UTF8BOM: | |
3138 | + cInfo2.Str = cInfo.Buf; | |
3139 | + cInfo2.StrLen = cInfo.OutLen; | |
3140 | + cInfo2.Buf = Buf3; | |
3141 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
3142 | + ConvSJIStoUTF8N(&cInfo2); | |
3143 | + break; | |
2933 | 3144 | } |
2934 | 3145 | break; |
2935 | 3146 | case KANJI_UTF8N: |
@@ -2957,6 +3168,41 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2957 | 3168 | memcpy(Buf3, cInfo.Buf, cInfo.OutLen); |
2958 | 3169 | cInfo2.OutLen = cInfo.OutLen; |
2959 | 3170 | break; |
3171 | + case KANJI_UTF8BOM: | |
3172 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
3173 | + cInfo2.OutLen = cInfo.OutLen; | |
3174 | + break; | |
3175 | + } | |
3176 | + break; | |
3177 | + case KANJI_UTF8BOM: | |
3178 | + switch(Pkt->KanjiCode) | |
3179 | + { | |
3180 | + case KANJI_SJIS: | |
3181 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
3182 | + cInfo2.OutLen = cInfo.OutLen; | |
3183 | + break; | |
3184 | + case KANJI_JIS: | |
3185 | + cInfo2.Str = cInfo.Buf; | |
3186 | + cInfo2.StrLen = cInfo.OutLen; | |
3187 | + cInfo2.Buf = Buf3; | |
3188 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
3189 | + ConvSJIStoJIS(&cInfo2); | |
3190 | + break; | |
3191 | + case KANJI_EUC: | |
3192 | + cInfo2.Str = cInfo.Buf; | |
3193 | + cInfo2.StrLen = cInfo.OutLen; | |
3194 | + cInfo2.Buf = Buf3; | |
3195 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
3196 | + ConvSJIStoEUC(&cInfo2); | |
3197 | + break; | |
3198 | + case KANJI_UTF8N: | |
3199 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
3200 | + cInfo2.OutLen = cInfo.OutLen; | |
3201 | + break; | |
3202 | + case KANJI_UTF8BOM: | |
3203 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
3204 | + cInfo2.OutLen = cInfo.OutLen; | |
3205 | + break; | |
2960 | 3206 | } |
2961 | 3207 | break; |
2962 | 3208 | } |
@@ -3382,6 +3628,8 @@ static void DispTransFileInfo(TRANSPACKET *Pkt, char *Title, int SkipButton, int | ||
3382 | 3628 | SendDlgItemMessage(Pkt->hWndTrans, TRANS_KANJI, WM_SETTEXT, 0, (LPARAM)MSGJPN123); |
3383 | 3629 | else if(Pkt->KanjiCode == KANJI_UTF8N) |
3384 | 3630 | SendDlgItemMessage(Pkt->hWndTrans, TRANS_KANJI, WM_SETTEXT, 0, (LPARAM)MSGJPN306); |
3631 | + else if(Pkt->KanjiCode == KANJI_UTF8BOM) | |
3632 | + SendDlgItemMessage(Pkt->hWndTrans, TRANS_KANJI, WM_SETTEXT, 0, (LPARAM)MSGJPN329); | |
3385 | 3633 | } |
3386 | 3634 | else |
3387 | 3635 | { |
@@ -1864,7 +1864,8 @@ static BOOL CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP | ||
1864 | 1864 | { HSET_SJIS_CNV, KANJI_SJIS }, |
1865 | 1865 | { HSET_JIS_CNV, KANJI_JIS }, |
1866 | 1866 | { HSET_EUC_CNV, KANJI_EUC }, |
1867 | - { HSET_UTF8N_CNV, KANJI_UTF8N } | |
1867 | + { HSET_UTF8N_CNV, KANJI_UTF8N }, | |
1868 | + { HSET_UTF8BOM_CNV, KANJI_UTF8BOM } | |
1868 | 1869 | }; |
1869 | 1870 | #define KANJIBUTTONS (sizeof(KanjiButton)/sizeof(RADIOBUTTON)) |
1870 | 1871 |
@@ -1912,6 +1913,7 @@ static BOOL CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP | ||
1912 | 1913 | case WM_COMMAND : |
1913 | 1914 | switch(GET_WM_COMMAND_ID(wParam, lParam)) |
1914 | 1915 | { |
1916 | + case HSET_SJIS_CNV : | |
1915 | 1917 | case HSET_JIS_CNV : |
1916 | 1918 | case HSET_EUC_CNV : |
1917 | 1919 | EnableWindow(GetDlgItem(hDlg, HSET_HANCNV), TRUE); |
@@ -1920,10 +1922,10 @@ static BOOL CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP | ||
1920 | 1922 | // UTF-8対応 |
1921 | 1923 | case HSET_NO_CNV : |
1922 | 1924 | case HSET_UTF8N_CNV : |
1925 | + case HSET_UTF8BOM_CNV : | |
1923 | 1926 | EnableWindow(GetDlgItem(hDlg, HSET_HANCNV), FALSE); |
1924 | 1927 | break; |
1925 | 1928 | |
1926 | - case HSET_SJIS_CNV : | |
1927 | 1929 | case HSET_FN_JIS_CNV : |
1928 | 1930 | case HSET_FN_EUC_CNV : |
1929 | 1931 | EnableWindow(GetDlgItem(hDlg, HSET_FN_HANCNV), TRUE); |
@@ -135,12 +135,20 @@ HWND hHelpWin = NULL; | ||
135 | 135 | /* 設定値 */ |
136 | 136 | int WinPosX = CW_USEDEFAULT; |
137 | 137 | int WinPosY = 0; |
138 | -int WinWidth = 630; | |
139 | -int WinHeight = 393; | |
140 | -int LocalWidth = 309; | |
141 | -int TaskHeight = 50; | |
142 | -int LocalTabWidth[4] = { 120, 90, 60, 37 }; | |
143 | -int RemoteTabWidth[6] = { 120, 90, 60, 37, 60, 60 }; | |
138 | +// 機能が増えたためサイズ変更 | |
139 | +// VGAサイズに収まるようになっていたのをSVGAサイズに引き上げ | |
140 | +//int WinWidth = 630; | |
141 | +//int WinHeight = 393; | |
142 | +//int LocalWidth = 309; | |
143 | +//int TaskHeight = 50; | |
144 | +//int LocalTabWidth[4] = { 120, 90, 60, 37 }; | |
145 | +//int RemoteTabWidth[6] = { 120, 90, 60, 37, 60, 60 }; | |
146 | +int WinWidth = 790; | |
147 | +int WinHeight = 513; | |
148 | +int LocalWidth = 389; | |
149 | +int TaskHeight = 100; | |
150 | +int LocalTabWidth[4] = { 160, 110, 60, 37 }; | |
151 | +int RemoteTabWidth[6] = { 160, 110, 60, 37, 60, 60 }; | |
144 | 152 | char UserMailAdrs[USER_MAIL_LEN+1] = { "who@example.com" }; |
145 | 153 | char ViewerName[VIEWERS][FMAX_PATH+1] = { { "notepad" }, { "" }, { "" } }; |
146 | 154 | HFONT ListFont = NULL; |
@@ -1148,6 +1156,7 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA | ||
1148 | 1156 | case MENU_KNJ_EUC : |
1149 | 1157 | case MENU_KNJ_JIS : |
1150 | 1158 | case MENU_KNJ_UTF8N : |
1159 | + case MENU_KNJ_UTF8BOM : | |
1151 | 1160 | case MENU_KNJ_NONE : |
1152 | 1161 | SetHostKanjiCode(LOWORD(wParam)); |
1153 | 1162 | break; |
@@ -1156,6 +1165,7 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA | ||
1156 | 1165 | case MENU_L_KNJ_EUC : |
1157 | 1166 | case MENU_L_KNJ_JIS : |
1158 | 1167 | case MENU_L_KNJ_UTF8N : |
1168 | + case MENU_L_KNJ_UTF8BOM : | |
1159 | 1169 | SetLocalKanjiCode(LOWORD(wParam)); |
1160 | 1170 | break; |
1161 | 1171 |
@@ -1446,6 +1456,10 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA | ||
1446 | 1456 | lpttt->lpszText = MSGJPN308; |
1447 | 1457 | break; |
1448 | 1458 | |
1459 | + case MENU_KNJ_UTF8BOM : | |
1460 | + lpttt->lpszText = MSGJPN330; | |
1461 | + break; | |
1462 | + | |
1449 | 1463 | case MENU_KNJ_NONE : |
1450 | 1464 | lpttt->lpszText = MSGJPN173; |
1451 | 1465 | break; |
@@ -1466,6 +1480,10 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA | ||
1466 | 1480 | lpttt->lpszText = MSGJPN312; |
1467 | 1481 | break; |
1468 | 1482 | |
1483 | + case MENU_L_KNJ_UTF8BOM : | |
1484 | + lpttt->lpszText = MSGJPN331; | |
1485 | + break; | |
1486 | + | |
1469 | 1487 | case MENU_KANACNV : |
1470 | 1488 | lpttt->lpszText = MSGJPN174; |
1471 | 1489 | break; |
@@ -326,3 +326,6 @@ | ||
326 | 326 | #define MSGJPN326 "Choose 'Yes' if you trust this certificate and continue.\r\nCN is identical: %s\r\nVerified successfully: %s\r\n\r\n%s" |
327 | 327 | #define MSGJPN327 "Yes" |
328 | 328 | #define MSGJPN328 "No" |
329 | +#define MSGJPN329 "UTF-8 BOM" | |
330 | +#define MSGJPN330 "UTF-8 BOM Kanji Code" | |
331 | +#define MSGJPN331 "UTF-8 BOM Kanji Code (Local)" |
@@ -326,3 +326,6 @@ | ||
326 | 326 | #define MSGJPN326 "Choose 'Yes' if you trust this certificate and continue.\r\nCN is identical: %s\r\nVerified successfully: %s\r\n\r\n%s" |
327 | 327 | #define MSGJPN327 "Yes" |
328 | 328 | #define MSGJPN328 "No" |
329 | +#define MSGJPN329 "UTF-8 BOM" | |
330 | +#define MSGJPN330 "UTF-8 BOM Kanji Code" | |
331 | +#define MSGJPN331 "UTF-8 BOM Kanji Code (Local)" |
@@ -326,3 +326,6 @@ | ||
326 | 326 | #define MSGJPN326 "\xE3\x81\x93\xE3\x81\xAE\xE8\xA8\xBC\xE6\x98\x8E\xE6\x9B\xB8\xE3\x82\x92\xE4\xBF\xA1\xE9\xA0\xBC\xE3\x81\x97,\xE9\x80\x9A\xE4\xBF\xA1\xE3\x82\x92\xE7\xB6\x9A\xE8\xA1\x8C\xE3\x81\x99\xE3\x82\x8B\xE3\x81\xAB\xE3\x81\xAF\xE3\x80\x8C\xE3\x81\xAF\xE3\x81\x84\xE3\x80\x8D\xE3\x82\x92\xE9\x81\xB8\xE6\x8A\x9E\xE3\x81\x97\xE3\x81\xA6\xE3\x81\x8F\xE3\x81\xA0\xE3\x81\x95\xE3\x81\x84.\r\nCN\xE3\x81\xAE\xE4\xB8\x80\xE8\x87\xB4: %s\r\n\xE6\xA4\x9C\xE8\xA8\xBC\xE3\x81\xAB\xE6\x88\x90\xE5\x8A\x9F: %s\r\n\r\n%s" |
327 | 327 | #define MSGJPN327 "\xE3\x81\xAF\xE3\x81\x84" |
328 | 328 | #define MSGJPN328 "\xE3\x81\x84\xE3\x81\x84\xE3\x81\x88" |
329 | +#define MSGJPN329 "UTF-8 BOM" | |
330 | +#define MSGJPN330 "\xE3\x83\x9B\xE3\x82\xB9\xE3\x83\x88\xE3\x81\xAE\xE6\xBC\xA2\xE5\xAD\x97\xE3\x82\xB3\xE3\x83\xBC\xE3\x83\x89\xE3\x81\xAFUTF-8 BOM" | |
331 | +#define MSGJPN331 "\xE3\x83\xAD\xE3\x83\xBC\xE3\x82\xAB\xE3\x83\xAB\xE3\x81\xAE\xE6\xBC\xA2\xE5\xAD\x97\xE3\x82\xB3\xE3\x83\xBC\xE3\x83\x89\xE3\x81\xAFUTF-8 BOM" |
@@ -326,3 +326,6 @@ | ||
326 | 326 | #define MSGJPN326 "この証明書を信頼し,通信を続行するには「はい」を選択してください.\r\nCNの一致: %s\r\n検証に成功: %s\r\n\r\n%s" |
327 | 327 | #define MSGJPN327 "はい" |
328 | 328 | #define MSGJPN328 "いいえ" |
329 | +#define MSGJPN329 "UTF-8 BOM" | |
330 | +#define MSGJPN330 "ホストの漢字コードはUTF-8 BOM" | |
331 | +#define MSGJPN331 "ローカルの漢字コードはUTF-8 BOM" |
@@ -877,6 +877,12 @@ int LoadRegistory(void) | ||
877 | 877 | ReadIntValueFromReg(hKey5, "Port", &Host.Port); |
878 | 878 | ReadIntValueFromReg(hKey5, "Anonymous", &Host.Anonymous); |
879 | 879 | ReadIntValueFromReg(hKey5, "Kanji", &Host.KanjiCode); |
880 | + // 1.98b以前のUTF-8はBOMあり | |
881 | + if(Version < 1983) | |
882 | + { | |
883 | + if(Host.KanjiCode == KANJI_UTF8N) | |
884 | + Host.KanjiCode = KANJI_UTF8BOM; | |
885 | + } | |
880 | 886 | ReadIntValueFromReg(hKey5, "KanaCnv", &Host.KanaCnv); |
881 | 887 | ReadIntValueFromReg(hKey5, "NameKanji", &Host.NameKanjiCode); |
882 | 888 | ReadIntValueFromReg(hKey5, "NameKana", &Host.NameKanaCnv); |
@@ -140,11 +140,13 @@ static TBBUTTON TbarDataMain[] = { | ||
140 | 140 | { 20, MENU_L_KNJ_EUC, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 }, |
141 | 141 | { 21, MENU_L_KNJ_JIS, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 }, |
142 | 142 | { 28, MENU_L_KNJ_UTF8N, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 }, |
143 | + { 29, MENU_L_KNJ_UTF8BOM, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 }, | |
143 | 144 | { 0, 0, TBSTATE_ENABLED, BTNS_SEP, 0, 0 }, |
144 | 145 | { 27, MENU_KNJ_SJIS, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 }, |
145 | 146 | { 20, MENU_KNJ_EUC, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 }, |
146 | 147 | { 21, MENU_KNJ_JIS, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 }, |
147 | 148 | { 28, MENU_KNJ_UTF8N, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 }, |
149 | + { 29, MENU_KNJ_UTF8BOM, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 }, | |
148 | 150 | { 22, MENU_KNJ_NONE, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 }, |
149 | 151 | { 0, 0, TBSTATE_ENABLED, BTNS_SEP, 0, 0 }, |
150 | 152 | { 23, MENU_KANACNV, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, 0 }, |
@@ -195,8 +197,8 @@ static const int HideMenus[] = { | ||
195 | 197 | MENU_HELP, MENU_HELP_TROUBLE, MENU_ABOUT, |
196 | 198 | MENU_REGINIT, |
197 | 199 | MENU_TEXT, MENU_BINARY, MENU_AUTO, |
198 | - MENU_KNJ_SJIS, MENU_KNJ_EUC, MENU_KNJ_JIS, MENU_KNJ_UTF8N, MENU_KNJ_NONE, | |
199 | - MENU_L_KNJ_SJIS, MENU_L_KNJ_EUC, MENU_L_KNJ_JIS, MENU_L_KNJ_UTF8N, | |
200 | + MENU_KNJ_SJIS, MENU_KNJ_EUC, MENU_KNJ_JIS, MENU_KNJ_UTF8N, MENU_KNJ_UTF8BOM, MENU_KNJ_NONE, | |
201 | + MENU_L_KNJ_SJIS, MENU_L_KNJ_EUC, MENU_L_KNJ_JIS, MENU_L_KNJ_UTF8N, MENU_L_KNJ_UTF8BOM, | |
200 | 202 | MENU_KANACNV, |
201 | 203 | MENU_LOCAL_UPDIR, MENU_LOCAL_CHDIR, |
202 | 204 | MENU_REMOTE_UPDIR, MENU_REMOTE_CHDIR, |
@@ -1028,6 +1030,10 @@ void SetHostKanjiCode(int Type) | ||
1028 | 1030 | TmpHostKanjiCode = KANJI_UTF8N; |
1029 | 1031 | break; |
1030 | 1032 | |
1033 | + case MENU_KNJ_UTF8BOM : | |
1034 | + TmpHostKanjiCode = KANJI_UTF8BOM; | |
1035 | + break; | |
1036 | + | |
1031 | 1037 | default : |
1032 | 1038 | TmpHostKanjiCode = KANJI_NOCNV; |
1033 | 1039 | break; |
@@ -1068,6 +1074,10 @@ void DispHostKanjiCode(void) | ||
1068 | 1074 | SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_KNJ_UTF8N, MAKELONG(TRUE, 0)); |
1069 | 1075 | break; |
1070 | 1076 | |
1077 | + case KANJI_UTF8BOM : | |
1078 | + SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_KNJ_UTF8BOM, MAKELONG(TRUE, 0)); | |
1079 | + break; | |
1080 | + | |
1071 | 1081 | default : |
1072 | 1082 | SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_KNJ_NONE, MAKELONG(TRUE, 0)); |
1073 | 1083 | break; |
@@ -1110,6 +1120,7 @@ void HideHostKanjiButton(void) | ||
1110 | 1120 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_EUC, MAKELONG(FALSE, 0)); |
1111 | 1121 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_JIS, MAKELONG(FALSE, 0)); |
1112 | 1122 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_UTF8N, MAKELONG(FALSE, 0)); |
1123 | + SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_UTF8BOM, MAKELONG(FALSE, 0)); | |
1113 | 1124 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_NONE, MAKELONG(FALSE, 0)); |
1114 | 1125 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(FALSE, 0)); |
1115 | 1126 | break; |
@@ -1119,6 +1130,7 @@ void HideHostKanjiButton(void) | ||
1119 | 1130 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_EUC, MAKELONG(TRUE, 0)); |
1120 | 1131 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_JIS, MAKELONG(TRUE, 0)); |
1121 | 1132 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_UTF8N, MAKELONG(TRUE, 0)); |
1133 | + SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_UTF8BOM, MAKELONG(TRUE, 0)); | |
1122 | 1134 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_NONE, MAKELONG(TRUE, 0)); |
1123 | 1135 | // if(TmpHostKanjiCode != KANJI_NOCNV) |
1124 | 1136 | // SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(TRUE, 0)); |
@@ -1179,6 +1191,10 @@ void SetLocalKanjiCode(int Type) | ||
1179 | 1191 | case MENU_L_KNJ_UTF8N : |
1180 | 1192 | TmpLocalKanjiCode = KANJI_UTF8N; |
1181 | 1193 | break; |
1194 | + | |
1195 | + case MENU_L_KNJ_UTF8BOM : | |
1196 | + TmpLocalKanjiCode = KANJI_UTF8BOM; | |
1197 | + break; | |
1182 | 1198 | } |
1183 | 1199 | DispLocalKanjiCode(); |
1184 | 1200 | HideLocalKanjiButton(); |
@@ -1205,6 +1221,10 @@ void DispLocalKanjiCode(void) | ||
1205 | 1221 | case KANJI_UTF8N : |
1206 | 1222 | SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_L_KNJ_UTF8N, MAKELONG(TRUE, 0)); |
1207 | 1223 | break; |
1224 | + | |
1225 | + case KANJI_UTF8BOM : | |
1226 | + SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_L_KNJ_UTF8BOM, MAKELONG(TRUE, 0)); | |
1227 | + break; | |
1208 | 1228 | } |
1209 | 1229 | return; |
1210 | 1230 | } |
@@ -1224,6 +1244,7 @@ void HideLocalKanjiButton(void) | ||
1224 | 1244 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_EUC, MAKELONG(FALSE, 0)); |
1225 | 1245 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_JIS, MAKELONG(FALSE, 0)); |
1226 | 1246 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_UTF8N, MAKELONG(FALSE, 0)); |
1247 | + SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_UTF8BOM, MAKELONG(FALSE, 0)); | |
1227 | 1248 | break; |
1228 | 1249 | |
1229 | 1250 | default : |
@@ -1231,6 +1252,7 @@ void HideLocalKanjiButton(void) | ||
1231 | 1252 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_EUC, MAKELONG(TRUE, 0)); |
1232 | 1253 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_JIS, MAKELONG(TRUE, 0)); |
1233 | 1254 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_UTF8N, MAKELONG(TRUE, 0)); |
1255 | + SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_UTF8BOM, MAKELONG(TRUE, 0)); | |
1234 | 1256 | // 現在カナ変換はShift_JIS、JIS、EUC間でのみ機能する |
1235 | 1257 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(FALSE, 0)); |
1236 | 1258 | switch(TmpHostKanjiCode) |