Loweynet
リビジョン | ace5228a5909b084161345b10e712b7937bb00c5 (tree) |
---|---|
日時 | 2011-09-09 18:07:23 |
作者 | s_kawamoto <s_kawamoto@user...> |
コミッター | s_kawamoto |
Fix bugs of text encoding routines.
Fix bugs of UTF-8 to UTF-16 API bridge.
Recover compatibility of registry settings.
Fix bugs of behavior of toolbar buttons.
Add support for JIS and EUC text mode transfer.
@@ -366,6 +366,8 @@ void InitCodeConvInfo(CODECONVINFO *cInfo) | ||
366 | 366 | cInfo->KanjiFst = 0; |
367 | 367 | cInfo->KanaPrev = 0; |
368 | 368 | cInfo->KanaProc = NULL; |
369 | + // UTF-8Î | |
370 | + cInfo->EscUTF8Len = 0; | |
369 | 371 | return; |
370 | 372 | } |
371 | 373 |
@@ -397,6 +399,9 @@ int FlushRestData(CODECONVINFO *cInfo) | ||
397 | 399 | *Put++ = cInfo->EscCode[0]; |
398 | 400 | if(cInfo->EscProc == 2) |
399 | 401 | *Put++ = cInfo->EscCode[1]; |
402 | + // UTF-8Î | |
403 | + memcpy(Put, cInfo->EscUTF8, sizeof(char) * cInfo->EscUTF8Len); | |
404 | + Put += cInfo->EscUTF8Len; | |
400 | 405 | |
401 | 406 | cInfo->OutLen = Put - cInfo->Buf; |
402 | 407 |
@@ -1478,75 +1483,133 @@ int ConvUTF8NtoSJIS(CODECONVINFO *cInfo) | ||
1478 | 1483 | { |
1479 | 1484 | int Continue; |
1480 | 1485 | |
1481 | - char temp_string[2048]; | |
1486 | +// char temp_string[2048]; | |
1482 | 1487 | int string_length; |
1483 | 1488 | |
1489 | + // å«¢TCYÉÎ | |
1490 | + // I[ÌNULLðÜÞoOðC³ | |
1491 | + int SrcLength; | |
1492 | + char* pSrc; | |
1493 | + wchar_t* pUTF16; | |
1494 | + int UTF16Length; | |
1495 | + int Count; | |
1496 | + | |
1484 | 1497 | Continue = NO; |
1485 | 1498 | |
1486 | 1499 | // ¶¬³êéÔR[hÌTCYð²×é |
1487 | - string_length = MultiByteToWideChar( | |
1488 | - CP_UTF8, // Ï·æ¶R[h | |
1489 | - 0, // tO(0:ȵ) | |
1490 | - cInfo->Str, // Ï·³¶ñ | |
1491 | - -1, // Ï·³¶ñoCg(-1:©®) | |
1492 | - NULL, // Ï·µ½¶ñÌi[æ | |
1493 | - 0 // i[æTCY | |
1494 | - ); | |
1500 | +// string_length = MultiByteToWideChar( | |
1501 | +// CP_UTF8, // Ï·æ¶R[h | |
1502 | +// 0, // tO(0:ȵ) | |
1503 | +// cInfo->Str, // Ï·³¶ñ | |
1504 | +// -1, // Ï·³¶ñoCg(-1:©®) | |
1505 | +// NULL, // Ï·µ½¶ñÌi[æ | |
1506 | +// 0 // i[æTCY | |
1507 | +// ); | |
1508 | + // OñÌÏ·s\Ècè̶ñðüÍÌæªÉ | |
1509 | + SrcLength = cInfo->StrLen + cInfo->EscUTF8Len; | |
1510 | + if(!(pSrc = (char*)malloc(sizeof(char) * (SrcLength + 1)))) | |
1511 | + { | |
1512 | + *(cInfo->Buf) = '\0'; | |
1513 | + cInfo->BufSize = 0; | |
1514 | + return Continue; | |
1515 | + } | |
1516 | + memcpy(pSrc, cInfo->EscUTF8, sizeof(char) * cInfo->EscUTF8Len); | |
1517 | + memcpy(pSrc + cInfo->EscUTF8Len, cInfo->Str, sizeof(char) * cInfo->StrLen); | |
1518 | + *(pSrc + SrcLength) = '\0'; | |
1519 | + // UTF-8ÌêAs®SȶÍíÉÏ·³êÈ¢ | |
1520 | + UTF16Length = MultiByteToWideChar(CP_UTF8, 0, pSrc, SrcLength, NULL, 0); | |
1495 | 1521 | |
1496 | 1522 | // TCY0 or obt@TCYæèå«¢êÍ |
1497 | 1523 | // cInfo->BufÌÅÉ'\0'ðüêÄA |
1498 | 1524 | // cInfo->BufSizeÉ0ðüêÄÔ·B |
1499 | - if( string_length == 0 || | |
1500 | - string_length >= 1024 ){ | |
1525 | +// if( string_length == 0 || | |
1526 | +// string_length >= 1024 ){ | |
1527 | +// *(cInfo->Buf) = '\0'; | |
1528 | +// cInfo->BufSize = 0; | |
1529 | +// return(Continue); | |
1530 | +// } | |
1531 | + if(!(pUTF16 = (wchar_t*)malloc(sizeof(wchar_t) * UTF16Length))) | |
1532 | + { | |
1533 | + free(pSrc); | |
1501 | 1534 | *(cInfo->Buf) = '\0'; |
1502 | 1535 | cInfo->BufSize = 0; |
1503 | - return(Continue); | |
1536 | + return Continue; | |
1504 | 1537 | } |
1505 | 1538 | |
1506 | 1539 | // ÔR[h(unicode)ÉÏ· |
1507 | - MultiByteToWideChar( | |
1508 | - CP_UTF8, // Ï·æ¶R[h | |
1509 | - 0, // tO(0:ȵ) | |
1510 | - cInfo->Str, // Ï·³¶ñ | |
1511 | - -1, // Ï·³¶ñoCg(-1:©®) | |
1512 | - (unsigned short *)temp_string, // Ï·µ½¶ñÌi[æ | |
1513 | - 1024 // i[æTCY | |
1514 | - ); | |
1540 | +// MultiByteToWideChar( | |
1541 | +// CP_UTF8, // Ï·æ¶R[h | |
1542 | +// 0, // tO(0:ȵ) | |
1543 | +// cInfo->Str, // Ï·³¶ñ | |
1544 | +// -1, // Ï·³¶ñoCg(-1:©®) | |
1545 | +// (unsigned short *)temp_string, // Ï·µ½¶ñÌi[æ | |
1546 | +// 1024 // i[æTCY | |
1547 | +// ); | |
1548 | + MultiByteToWideChar(CP_UTF8, 0, pSrc, SrcLength, pUTF16, UTF16Length); | |
1515 | 1549 | |
1516 | 1550 | // ¶¬³êéUTF-8R[hÌTCYð²×é |
1517 | - string_length = WideCharToMultiByte( | |
1518 | - CP_ACP, // Ï·æ¶R[h | |
1519 | - 0, // tO(0:ȵ) | |
1520 | - (unsigned short *)temp_string, // Ï·³¶ñ | |
1521 | - -1, // Ï·³¶ñoCg(-1:©®) | |
1522 | - NULL, // Ï·µ½¶ñÌi[æ | |
1523 | - 0, // i[æTCY | |
1524 | - NULL,NULL | |
1525 | - ); | |
1551 | +// string_length = WideCharToMultiByte( | |
1552 | +// CP_ACP, // Ï·æ¶R[h | |
1553 | +// 0, // tO(0:ȵ) | |
1554 | +// (unsigned short *)temp_string, // Ï·³¶ñ | |
1555 | +// -1, // Ï·³¶ñoCg(-1:©®) | |
1556 | +// NULL, // Ï·µ½¶ñÌi[æ | |
1557 | +// 0, // i[æTCY | |
1558 | +// NULL,NULL | |
1559 | +// ); | |
1560 | + string_length = WideCharToMultiByte(CP_ACP, 0, pUTF16, UTF16Length, NULL, 0, NULL, NULL); | |
1526 | 1561 | |
1527 | 1562 | // TCY0 or oÍobt@TCYæèå«¢êÍA |
1528 | 1563 | // cInfo->BufÌÅÉ'\0'ðüêÄA |
1529 | 1564 | // cInfo->BufSizeÉ0ðüêÄÔ·B |
1530 | - if( string_length == 0 || | |
1531 | - string_length >= cInfo->BufSize ){ | |
1532 | - *(cInfo->Buf) = '\0'; | |
1533 | - cInfo->BufSize = 0; | |
1534 | - return(Continue); | |
1535 | - } | |
1565 | +// if( string_length == 0 || | |
1566 | +// string_length >= cInfo->BufSize ){ | |
1567 | +// *(cInfo->Buf) = '\0'; | |
1568 | +// cInfo->BufSize = 0; | |
1569 | +// return(Continue); | |
1570 | +// } | |
1536 | 1571 | |
1537 | 1572 | // oÍTCYðÝè |
1538 | - cInfo->OutLen = string_length; | |
1573 | +// cInfo->OutLen = string_length; | |
1539 | 1574 | |
1540 | 1575 | // UTF-8R[hÉÏ· |
1541 | - WideCharToMultiByte( | |
1542 | - CP_ACP, // Ï·æ¶R[h | |
1543 | - 0, // tO(0:ȵ) | |
1544 | - (unsigned short *)temp_string, // Ï·³¶ñ | |
1545 | - -1, // Ï·³¶ñoCg(-1:©®) | |
1546 | - cInfo->Buf, // Ï·µ½¶ñÌi[æ(BOM:3bytes) | |
1547 | - cInfo->BufSize, // i[æTCY | |
1548 | - NULL,NULL | |
1549 | - ); | |
1576 | +// WideCharToMultiByte( | |
1577 | +// CP_ACP, // Ï·æ¶R[h | |
1578 | +// 0, // tO(0:ȵ) | |
1579 | +// (unsigned short *)temp_string, // Ï·³¶ñ | |
1580 | +// -1, // Ï·³¶ñoCg(-1:©®) | |
1581 | +// cInfo->Buf, // Ï·µ½¶ñÌi[æ(BOM:3bytes) | |
1582 | +// cInfo->BufSize, // i[æTCY | |
1583 | +// NULL,NULL | |
1584 | +// ); | |
1585 | + cInfo->OutLen = WideCharToMultiByte(CP_ACP, 0, pUTF16, UTF16Length, cInfo->Buf, cInfo->BufSize, NULL, NULL); | |
1586 | + // obt@ÉûÜçÈ¢½ßÏ·¶ð¼¸ | |
1587 | + while(cInfo->OutLen == 0 && UTF16Length > 0) | |
1588 | + { | |
1589 | + UTF16Length = UTF16Length / 2; | |
1590 | + cInfo->OutLen = WideCharToMultiByte(CP_ACP, 0, pUTF16, UTF16Length, cInfo->Buf, cInfo->BufSize, NULL, NULL); | |
1591 | + } | |
1592 | + // Ï·³ê½³Ì¶ñÅ̶ðæ¾ | |
1593 | + Count = WideCharToMultiByte(CP_UTF8, 0, pUTF16, UTF16Length, NULL, 0, NULL, NULL); | |
1594 | + // Ï·Â\Ècè̶ðæ¾ | |
1595 | + UTF16Length = MultiByteToWideChar(CP_UTF8, 0, pSrc + Count, SrcLength - Count, NULL, 0); | |
1596 | + cInfo->Str += Count - cInfo->EscUTF8Len; | |
1597 | + cInfo->StrLen -= Count - cInfo->EscUTF8Len; | |
1598 | + cInfo->EscUTF8Len = 0; | |
1599 | + if(UTF16Length > 0) | |
1600 | + Continue = YES; | |
1601 | + else | |
1602 | + { | |
1603 | + // Ï·s\ȽßÌüÍÌæªÉ | |
1604 | + memcpy(cInfo->EscUTF8, cInfo->Str, sizeof(char) * cInfo->StrLen); | |
1605 | + cInfo->EscUTF8Len = cInfo->StrLen; | |
1606 | + cInfo->Str += cInfo->StrLen; | |
1607 | + cInfo->StrLen = 0; | |
1608 | + Continue = NO; | |
1609 | + } | |
1610 | + | |
1611 | + free(pSrc); | |
1612 | + free(pUTF16); | |
1550 | 1613 | |
1551 | 1614 | return(Continue); |
1552 | 1615 | } |
@@ -1566,64 +1629,112 @@ int ConvSJIStoUTF8N(CODECONVINFO *cInfo) | ||
1566 | 1629 | { |
1567 | 1630 | int Continue; |
1568 | 1631 | |
1569 | - char temp_string[2048]; | |
1632 | +// char temp_string[2048]; | |
1570 | 1633 | int string_length; |
1571 | 1634 | |
1635 | + // å«¢TCYÉÎ | |
1636 | + // I[ÌNULLðÜÞoOðC³ | |
1637 | + int SrcLength; | |
1638 | + char* pSrc; | |
1639 | + wchar_t* pUTF16; | |
1640 | + int UTF16Length; | |
1641 | + int Count; | |
1642 | + | |
1572 | 1643 | Continue = NO; |
1573 | 1644 | |
1574 | 1645 | // ¶¬³êéÔR[hÌTCYð²×é |
1575 | - string_length = MultiByteToWideChar( | |
1576 | - CP_ACP, // Ï·æ¶R[h | |
1577 | - 0, // tO(0:ȵ) | |
1578 | - cInfo->Str, // Ï·³¶ñ | |
1579 | - -1, // Ï·³¶ñoCg(-1:©®) | |
1580 | - NULL, // Ï·µ½¶ñÌi[æ | |
1581 | - 0 // i[æTCY | |
1582 | - ); | |
1646 | +// string_length = MultiByteToWideChar( | |
1647 | +// CP_ACP, // Ï·æ¶R[h | |
1648 | +// 0, // tO(0:ȵ) | |
1649 | +// cInfo->Str, // Ï·³¶ñ | |
1650 | +// -1, // Ï·³¶ñoCg(-1:©®) | |
1651 | +// NULL, // Ï·µ½¶ñÌi[æ | |
1652 | +// 0 // i[æTCY | |
1653 | +// ); | |
1654 | + // OñÌÏ·s\Ècè̶ñðüÍÌæªÉ | |
1655 | + SrcLength = cInfo->StrLen + cInfo->EscUTF8Len; | |
1656 | + if(!(pSrc = (char*)malloc(sizeof(char) * (SrcLength + 1)))) | |
1657 | + { | |
1658 | + *(cInfo->Buf) = '\0'; | |
1659 | + cInfo->BufSize = 0; | |
1660 | + return Continue; | |
1661 | + } | |
1662 | + memcpy(pSrc, cInfo->EscUTF8, sizeof(char) * cInfo->EscUTF8Len); | |
1663 | + memcpy(pSrc + cInfo->EscUTF8Len, cInfo->Str, sizeof(char) * cInfo->StrLen); | |
1664 | + *(pSrc + SrcLength) = '\0'; | |
1665 | + // Shift_JISÌêAs®SȶÅàÏ·³êé±Æª é½ßAöÌs®SȪðíé | |
1666 | + Count = 0; | |
1667 | + while(Count < SrcLength) | |
1668 | + { | |
1669 | + if(((unsigned char)*(pSrc + Count) >= 0x81 && (unsigned char)*(pSrc + Count) <= 0x9f) || (unsigned char)*(pSrc + Count) >= 0xe0) | |
1670 | + { | |
1671 | + if((unsigned char)*(pSrc + Count + 1) >= 0x40) | |
1672 | + Count += 2; | |
1673 | + else | |
1674 | + { | |
1675 | + if(Count + 2 > SrcLength) | |
1676 | + break; | |
1677 | + Count += 1; | |
1678 | + } | |
1679 | + } | |
1680 | + else | |
1681 | + Count += 1; | |
1682 | + } | |
1683 | + SrcLength = Count; | |
1684 | + UTF16Length = MultiByteToWideChar(CP_ACP, 0, pSrc, SrcLength, NULL, 0); | |
1583 | 1685 | |
1584 | 1686 | // TCY0 or obt@TCYæèå«¢êÍA |
1585 | 1687 | // cInfo->BufÌÅÉ'\0'ðüêÄA |
1586 | 1688 | // cInfo->BufSizeÉ0ðüêÄÔ·B |
1587 | - if( string_length == 0 || | |
1588 | - string_length >= 1024 ){ | |
1689 | +// if( string_length == 0 || | |
1690 | +// string_length >= 1024 ){ | |
1691 | +// *(cInfo->Buf) = '\0'; | |
1692 | +// cInfo->BufSize = 0; | |
1693 | +// return(Continue); | |
1694 | +// } | |
1695 | + if(!(pUTF16 = (wchar_t*)malloc(sizeof(wchar_t) * UTF16Length))) | |
1696 | + { | |
1697 | + free(pSrc); | |
1589 | 1698 | *(cInfo->Buf) = '\0'; |
1590 | 1699 | cInfo->BufSize = 0; |
1591 | - return(Continue); | |
1700 | + return Continue; | |
1592 | 1701 | } |
1593 | 1702 | |
1594 | 1703 | // ÔR[h(unicode)ÉÏ· |
1595 | - MultiByteToWideChar( | |
1596 | - CP_ACP, // Ï·æ¶R[h | |
1597 | - 0, // tO(0:ȵ) | |
1598 | - cInfo->Str, // Ï·³¶ñ | |
1599 | - -1, // Ï·³¶ñoCg(-1:©®) | |
1600 | - (unsigned short *)temp_string, // Ï·µ½¶ñÌi[æ | |
1601 | - 1024 // i[æTCY | |
1602 | - ); | |
1704 | +// MultiByteToWideChar( | |
1705 | +// CP_ACP, // Ï·æ¶R[h | |
1706 | +// 0, // tO(0:ȵ) | |
1707 | +// cInfo->Str, // Ï·³¶ñ | |
1708 | +// -1, // Ï·³¶ñoCg(-1:©®) | |
1709 | +// (unsigned short *)temp_string, // Ï·µ½¶ñÌi[æ | |
1710 | +// 1024 // i[æTCY | |
1711 | +// ); | |
1712 | + MultiByteToWideChar(CP_ACP, 0, pSrc, SrcLength, pUTF16, UTF16Length); | |
1603 | 1713 | |
1604 | 1714 | // ¶¬³êéUTF-8R[hÌTCYð²×é |
1605 | - string_length = WideCharToMultiByte( | |
1606 | - CP_UTF8, // Ï·æ¶R[h | |
1607 | - 0, // tO(0:ȵ) | |
1608 | - (unsigned short *)temp_string, // Ï·³¶ñ | |
1609 | - -1, // Ï·³¶ñoCg(-1:©®) | |
1610 | - NULL, // Ï·µ½¶ñÌi[æ | |
1611 | - 0, // i[æTCY | |
1612 | - NULL,NULL | |
1613 | - ); | |
1715 | +// string_length = WideCharToMultiByte( | |
1716 | +// CP_UTF8, // Ï·æ¶R[h | |
1717 | +// 0, // tO(0:ȵ) | |
1718 | +// (unsigned short *)temp_string, // Ï·³¶ñ | |
1719 | +// -1, // Ï·³¶ñoCg(-1:©®) | |
1720 | +// NULL, // Ï·µ½¶ñÌi[æ | |
1721 | +// 0, // i[æTCY | |
1722 | +// NULL,NULL | |
1723 | +// ); | |
1724 | + string_length = WideCharToMultiByte(CP_UTF8, 0, pUTF16, UTF16Length, NULL, 0, NULL, NULL); | |
1614 | 1725 | |
1615 | 1726 | // TCY0 or oÍobt@TCYæèå«¢êÍA |
1616 | 1727 | // cInfo->BufÌÅÉ'\0'ðüêÄA |
1617 | 1728 | // cInfo->BufSizeÉ0ðüêÄÔ·B |
1618 | - if( string_length == 0 || | |
1619 | - string_length >= cInfo->BufSize ){ | |
1620 | - *(cInfo->Buf) = '\0'; | |
1621 | - cInfo->BufSize = 0; | |
1622 | - return(Continue); | |
1623 | - } | |
1729 | +// if( string_length == 0 || | |
1730 | +// string_length >= cInfo->BufSize ){ | |
1731 | +// *(cInfo->Buf) = '\0'; | |
1732 | +// cInfo->BufSize = 0; | |
1733 | +// return(Continue); | |
1734 | +// } | |
1624 | 1735 | |
1625 | 1736 | // oÍTCYðÝè |
1626 | - cInfo->OutLen = string_length; | |
1737 | +// cInfo->OutLen = string_length; | |
1627 | 1738 | |
1628 | 1739 | /* |
1629 | 1740 | // «t¯¿á¾ß R}hÉàÇÁ³êĵܤ |
@@ -1634,15 +1745,43 @@ int ConvSJIStoUTF8N(CODECONVINFO *cInfo) | ||
1634 | 1745 | */ |
1635 | 1746 | |
1636 | 1747 | // UTF-8R[hÉÏ· |
1637 | - WideCharToMultiByte( | |
1638 | - CP_UTF8, // Ï·æ¶R[h | |
1639 | - 0, // tO(0:ȵ) | |
1640 | - (unsigned short *)temp_string, // Ï·³¶ñ | |
1641 | - -1, // Ï·³¶ñoCg(-1:©®) | |
1642 | - cInfo->Buf, // Ï·µ½¶ñÌi[æ(BOM:3bytes) | |
1643 | - cInfo->BufSize, // i[æTCY | |
1644 | - NULL,NULL | |
1645 | - ); | |
1748 | +// WideCharToMultiByte( | |
1749 | +// CP_UTF8, // Ï·æ¶R[h | |
1750 | +// 0, // tO(0:ȵ) | |
1751 | +// (unsigned short *)temp_string, // Ï·³¶ñ | |
1752 | +// -1, // Ï·³¶ñoCg(-1:©®) | |
1753 | +// cInfo->Buf, // Ï·µ½¶ñÌi[æ(BOM:3bytes) | |
1754 | +// cInfo->BufSize, // i[æTCY | |
1755 | +// NULL,NULL | |
1756 | +// ); | |
1757 | + cInfo->OutLen = WideCharToMultiByte(CP_UTF8, 0, pUTF16, UTF16Length, cInfo->Buf, cInfo->BufSize, NULL, NULL); | |
1758 | + // obt@ÉûÜçÈ¢½ßÏ·¶ð¼¸ | |
1759 | + while(cInfo->OutLen == 0 && UTF16Length > 0) | |
1760 | + { | |
1761 | + UTF16Length = UTF16Length / 2; | |
1762 | + cInfo->OutLen = WideCharToMultiByte(CP_UTF8, 0, pUTF16, UTF16Length, cInfo->Buf, cInfo->BufSize, NULL, NULL); | |
1763 | + } | |
1764 | + // Ï·³ê½³Ì¶ñÅ̶ðæ¾ | |
1765 | + Count = WideCharToMultiByte(CP_ACP, 0, pUTF16, UTF16Length, NULL, 0, NULL, NULL); | |
1766 | + // Ï·Â\Ècè̶ðæ¾ | |
1767 | + UTF16Length = MultiByteToWideChar(CP_ACP, 0, pSrc + Count, SrcLength - Count, NULL, 0); | |
1768 | + cInfo->Str += Count - cInfo->EscUTF8Len; | |
1769 | + cInfo->StrLen -= Count - cInfo->EscUTF8Len; | |
1770 | + cInfo->EscUTF8Len = 0; | |
1771 | + if(UTF16Length > 0) | |
1772 | + Continue = YES; | |
1773 | + else | |
1774 | + { | |
1775 | + // Ï·s\ȽßÌüÍÌæªÉ | |
1776 | + memcpy(cInfo->EscUTF8, cInfo->Str, sizeof(char) * cInfo->StrLen); | |
1777 | + cInfo->EscUTF8Len = cInfo->StrLen; | |
1778 | + cInfo->Str += cInfo->StrLen; | |
1779 | + cInfo->StrLen = 0; | |
1780 | + Continue = NO; | |
1781 | + } | |
1782 | + | |
1783 | + free(pSrc); | |
1784 | + free(pUTF16); | |
1646 | 1785 | |
1647 | 1786 | return(Continue); |
1648 | 1787 | } |
@@ -669,16 +669,16 @@ LIST_UNIX_70 | ||
669 | 669 | |
670 | 670 | /*===== ¿R[hÏ· =====*/ |
671 | 671 | |
672 | -#define KANJI_SJIS 1 /* SJIS */ | |
673 | -#define KANJI_JIS 2 /* JIS */ | |
674 | -#define KANJI_EUC 3 /* EUC */ | |
675 | -#define KANJI_SMB_HEX 4 /* Samba-HEX */ | |
676 | -#define KANJI_SMB_CAP 5 /* Samba-CAP */ | |
677 | -#define KANJI_UTF8N 6 /* UTF-8N */ | |
672 | +#define KANJI_SJIS 0 /* SJIS */ | |
673 | +#define KANJI_JIS 1 /* JIS */ | |
674 | +#define KANJI_EUC 2 /* EUC */ | |
675 | +#define KANJI_SMB_HEX 3 /* Samba-HEX */ | |
676 | +#define KANJI_SMB_CAP 4 /* Samba-CAP */ | |
677 | +#define KANJI_UTF8N 5 /* UTF-8N */ | |
678 | 678 | |
679 | -#define KANJI_NOCNV 0 /* ¿R[hϷȵ */ | |
679 | +#define KANJI_NOCNV -1 /* ¿R[hϷȵ */ | |
680 | 680 | |
681 | -#define KANJI_AUTO 0 | |
681 | +#define KANJI_AUTO -1 | |
682 | 682 | |
683 | 683 | /*===== TEh =====*/ |
684 | 684 |
@@ -1003,6 +1003,8 @@ typedef struct codeconvinfo { | ||
1003 | 1003 | char KanjiFst; /* ¿R[hPoCgÚÛ¶p (àp[N) */ |
1004 | 1004 | char KanaPrev; /* ¼pJ^JiÛ¶p (àp[N) */ |
1005 | 1005 | funcptr KanaProc; /* ¼pJ^Ji[` (àp[N) */ |
1006 | + char EscUTF8[8]; | |
1007 | + int EscUTF8Len; | |
1006 | 1008 | } CODECONVINFO; |
1007 | 1009 | |
1008 | 1010 |
@@ -1234,10 +1236,6 @@ void SetHostKanjiCode(int Type); | ||
1234 | 1236 | void DispHostKanjiCode(void); |
1235 | 1237 | int AskHostKanjiCode(void); |
1236 | 1238 | void HideHostKanjiButton(void); |
1237 | -void SetHostKanaCnvImm(int Mode); | |
1238 | -void SetHostKanaCnv(void); | |
1239 | -void DispHostKanaCnv(void); | |
1240 | -int AskHostKanaCnv(void); | |
1241 | 1239 | // [JÌ¿R[h |
1242 | 1240 | void SetLocalKanjiCodeImm(int Mode); |
1243 | 1241 | void SetLocalKanjiCode(int Type); |
@@ -1245,6 +1243,10 @@ void DispLocalKanjiCode(void); | ||
1245 | 1243 | int AskLocalKanjiCode(void); |
1246 | 1244 | void HideLocalKanjiButton(void); |
1247 | 1245 | // ±±ÜÅ |
1246 | +void SetHostKanaCnvImm(int Mode); | |
1247 | +void SetHostKanaCnv(void); | |
1248 | +void DispHostKanaCnv(void); | |
1249 | +int AskHostKanaCnv(void); | |
1248 | 1250 | void SetSortTypeImm(int LFsort, int LDsort, int RFsort, int RDsort); |
1249 | 1251 | void SetSortTypeByColumn(int Win, int Tab); |
1250 | 1252 | int AskSortType(int Name); |
@@ -1179,6 +1179,8 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1179 | 1179 | if((iFileHandle = CreateFile(Pkt->LocalFile, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, &Sec, CreateMode, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) |
1180 | 1180 | { |
1181 | 1181 | // UTF-8Î |
1182 | + char Buf3[(BUFSIZE + 3) * 4]; | |
1183 | + CODECONVINFO cInfo2; | |
1182 | 1184 | int ProcessedBOM = NO; |
1183 | 1185 | if(CreateMode == OPEN_ALWAYS) |
1184 | 1186 | SetFilePointer(iFileHandle, 0, 0, FILE_END); |
@@ -1192,6 +1194,9 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1192 | 1194 | InitCodeConvInfo(&cInfo); |
1193 | 1195 | cInfo.KanaCnv = Pkt->KanaCnv; |
1194 | 1196 | |
1197 | + InitCodeConvInfo(&cInfo2); | |
1198 | + cInfo2.KanaCnv = Pkt->KanaCnv; | |
1199 | + | |
1195 | 1200 | /*===== t@CðóM·é[v =====*/ |
1196 | 1201 | while((Pkt->Abort == ABORT_NONE) && (ForceAbort == NO)) |
1197 | 1202 | { |
@@ -1262,13 +1267,26 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1262 | 1267 | switch(Pkt->KanjiCodeDesired) |
1263 | 1268 | { |
1264 | 1269 | case KANJI_SJIS: |
1265 | - memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
1266 | - cInfo2.OutLen = cInfo.StrLen; | |
1267 | - Continue = NO; | |
1270 | +// memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
1271 | +// cInfo2.OutLen = cInfo.StrLen; | |
1272 | +// Continue = NO; | |
1273 | + // JiÏ·Ì½ß | |
1274 | + Continue = ConvSJIStoJIS(&cInfo); | |
1275 | + cInfo2.Str = cInfo.Buf; | |
1276 | + cInfo2.StrLen = cInfo.OutLen; | |
1277 | + cInfo2.Buf = Buf3; | |
1278 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1279 | + ConvJIStoSJIS(&cInfo2); | |
1268 | 1280 | break; |
1269 | 1281 | case KANJI_JIS: |
1282 | + Continue = ConvSJIStoJIS(&cInfo); | |
1283 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1284 | + cInfo2.OutLen = cInfo.OutLen; | |
1270 | 1285 | break; |
1271 | 1286 | case KANJI_EUC: |
1287 | + Continue = ConvSJIStoEUC(&cInfo); | |
1288 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1289 | + cInfo2.OutLen = cInfo.OutLen; | |
1272 | 1290 | break; |
1273 | 1291 | case KANJI_UTF8N: |
1274 | 1292 | if(ProcessedBOM == NO) |
@@ -1280,7 +1298,7 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1280 | 1298 | break; |
1281 | 1299 | } |
1282 | 1300 | Continue = ConvSJIStoUTF8N(&cInfo); |
1283 | - memcpy(Buf3, Buf2, cInfo.OutLen); | |
1301 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1284 | 1302 | cInfo2.OutLen = cInfo.OutLen; |
1285 | 1303 | break; |
1286 | 1304 | } |
@@ -1290,15 +1308,28 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1290 | 1308 | { |
1291 | 1309 | case KANJI_SJIS: |
1292 | 1310 | Continue = ConvJIStoSJIS(&cInfo); |
1293 | - memcpy(Buf3, Buf2, cInfo.OutLen); | |
1311 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1294 | 1312 | cInfo2.OutLen = cInfo.OutLen; |
1295 | 1313 | break; |
1296 | 1314 | case KANJI_JIS: |
1297 | - memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
1298 | - cInfo2.OutLen = cInfo.StrLen; | |
1299 | - Continue = NO; | |
1315 | +// memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
1316 | +// cInfo2.OutLen = cInfo.StrLen; | |
1317 | +// Continue = NO; | |
1318 | + // JiÏ·Ì½ß | |
1319 | + Continue = ConvJIStoSJIS(&cInfo); | |
1320 | + cInfo2.Str = cInfo.Buf; | |
1321 | + cInfo2.StrLen = cInfo.OutLen; | |
1322 | + cInfo2.Buf = Buf3; | |
1323 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1324 | + ConvSJIStoJIS(&cInfo2); | |
1300 | 1325 | break; |
1301 | 1326 | case KANJI_EUC: |
1327 | + Continue = ConvJIStoSJIS(&cInfo); | |
1328 | + cInfo2.Str = cInfo.Buf; | |
1329 | + cInfo2.StrLen = cInfo.OutLen; | |
1330 | + cInfo2.Buf = Buf3; | |
1331 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1332 | + ConvSJIStoEUC(&cInfo2); | |
1302 | 1333 | break; |
1303 | 1334 | case KANJI_UTF8N: |
1304 | 1335 | if(ProcessedBOM == NO) |
@@ -1310,8 +1341,6 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1310 | 1341 | break; |
1311 | 1342 | } |
1312 | 1343 | Continue = ConvJIStoSJIS(&cInfo); |
1313 | - InitCodeConvInfo(&cInfo2); | |
1314 | - cInfo2.KanaCnv = NO; | |
1315 | 1344 | cInfo2.Str = cInfo.Buf; |
1316 | 1345 | cInfo2.StrLen = cInfo.OutLen; |
1317 | 1346 | cInfo2.Buf = Buf3; |
@@ -1325,15 +1354,28 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1325 | 1354 | { |
1326 | 1355 | case KANJI_SJIS: |
1327 | 1356 | Continue = ConvEUCtoSJIS(&cInfo); |
1328 | - memcpy(Buf3, Buf2, cInfo.OutLen); | |
1357 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1329 | 1358 | cInfo2.OutLen = cInfo.OutLen; |
1330 | 1359 | break; |
1331 | 1360 | case KANJI_JIS: |
1361 | + Continue = ConvEUCtoSJIS(&cInfo); | |
1362 | + cInfo2.Str = cInfo.Buf; | |
1363 | + cInfo2.StrLen = cInfo.OutLen; | |
1364 | + cInfo2.Buf = Buf3; | |
1365 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1366 | + ConvSJIStoJIS(&cInfo2); | |
1332 | 1367 | break; |
1333 | 1368 | case KANJI_EUC: |
1334 | - memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
1335 | - cInfo2.OutLen = cInfo.StrLen; | |
1336 | - Continue = NO; | |
1369 | +// memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
1370 | +// cInfo2.OutLen = cInfo.StrLen; | |
1371 | +// Continue = NO; | |
1372 | + // JiÏ·Ì½ß | |
1373 | + Continue = ConvEUCtoSJIS(&cInfo); | |
1374 | + cInfo2.Str = cInfo.Buf; | |
1375 | + cInfo2.StrLen = cInfo.OutLen; | |
1376 | + cInfo2.Buf = Buf3; | |
1377 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1378 | + ConvSJIStoEUC(&cInfo2); | |
1337 | 1379 | break; |
1338 | 1380 | case KANJI_UTF8N: |
1339 | 1381 | if(ProcessedBOM == NO) |
@@ -1345,8 +1387,6 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1345 | 1387 | break; |
1346 | 1388 | } |
1347 | 1389 | Continue = ConvEUCtoSJIS(&cInfo); |
1348 | - InitCodeConvInfo(&cInfo2); | |
1349 | - cInfo2.KanaCnv = NO; | |
1350 | 1390 | cInfo2.Str = cInfo.Buf; |
1351 | 1391 | cInfo2.StrLen = cInfo.OutLen; |
1352 | 1392 | cInfo2.Buf = Buf3; |
@@ -1379,12 +1419,24 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1379 | 1419 | { |
1380 | 1420 | case KANJI_SJIS: |
1381 | 1421 | Continue = ConvUTF8NtoSJIS(&cInfo); |
1382 | - memcpy(Buf3, Buf2, cInfo.OutLen); | |
1422 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1383 | 1423 | cInfo2.OutLen = cInfo.OutLen; |
1384 | 1424 | break; |
1385 | 1425 | case KANJI_JIS: |
1426 | + Continue = ConvUTF8NtoSJIS(&cInfo); | |
1427 | + cInfo2.Str = cInfo.Buf; | |
1428 | + cInfo2.StrLen = cInfo.OutLen; | |
1429 | + cInfo2.Buf = Buf3; | |
1430 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1431 | + ConvSJIStoJIS(&cInfo2); | |
1386 | 1432 | break; |
1387 | 1433 | case KANJI_EUC: |
1434 | + Continue = ConvUTF8NtoSJIS(&cInfo); | |
1435 | + cInfo2.Str = cInfo.Buf; | |
1436 | + cInfo2.StrLen = cInfo.OutLen; | |
1437 | + cInfo2.Buf = Buf3; | |
1438 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1439 | + ConvSJIStoEUC(&cInfo2); | |
1388 | 1440 | break; |
1389 | 1441 | case KANJI_UTF8N: |
1390 | 1442 | memcpy(Buf3, cInfo.Str, cInfo.StrLen); |
@@ -1425,7 +1477,130 @@ static int DownLoadFile(TRANSPACKET *Pkt, SOCKET dSkt, int CreateMode, int *Canc | ||
1425 | 1477 | cInfo.Buf = Buf2; |
1426 | 1478 | cInfo.BufSize = BUFSIZE+3; |
1427 | 1479 | FlushRestData(&cInfo); |
1428 | - if(WriteFile(iFileHandle, Buf2, cInfo.OutLen, &Writed, NULL) == FALSE) | |
1480 | + switch(Pkt->KanjiCode) | |
1481 | + { | |
1482 | + case KANJI_SJIS: | |
1483 | + switch(Pkt->KanjiCodeDesired) | |
1484 | + { | |
1485 | + case KANJI_SJIS: | |
1486 | + // JiÏ·Ì½ß | |
1487 | + cInfo2.Str = cInfo.Buf; | |
1488 | + cInfo2.StrLen = cInfo.OutLen; | |
1489 | + cInfo2.Buf = Buf3; | |
1490 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1491 | + ConvJIStoSJIS(&cInfo2); | |
1492 | + break; | |
1493 | + case KANJI_JIS: | |
1494 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1495 | + cInfo2.OutLen = cInfo.OutLen; | |
1496 | + break; | |
1497 | + case KANJI_EUC: | |
1498 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1499 | + cInfo2.OutLen = cInfo.OutLen; | |
1500 | + break; | |
1501 | + case KANJI_UTF8N: | |
1502 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1503 | + cInfo2.OutLen = cInfo.OutLen; | |
1504 | + break; | |
1505 | + } | |
1506 | + break; | |
1507 | + case KANJI_JIS: | |
1508 | + switch(Pkt->KanjiCodeDesired) | |
1509 | + { | |
1510 | + case KANJI_SJIS: | |
1511 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1512 | + cInfo2.OutLen = cInfo.OutLen; | |
1513 | + break; | |
1514 | + case KANJI_JIS: | |
1515 | + // JiÏ·Ì½ß | |
1516 | + cInfo2.Str = cInfo.Buf; | |
1517 | + cInfo2.StrLen = cInfo.OutLen; | |
1518 | + cInfo2.Buf = Buf3; | |
1519 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1520 | + ConvSJIStoJIS(&cInfo2); | |
1521 | + break; | |
1522 | + case KANJI_EUC: | |
1523 | + cInfo2.Str = cInfo.Buf; | |
1524 | + cInfo2.StrLen = cInfo.OutLen; | |
1525 | + cInfo2.Buf = Buf3; | |
1526 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1527 | + ConvSJIStoEUC(&cInfo2); | |
1528 | + break; | |
1529 | + case KANJI_UTF8N: | |
1530 | + cInfo2.Str = cInfo.Buf; | |
1531 | + cInfo2.StrLen = cInfo.OutLen; | |
1532 | + cInfo2.Buf = Buf3; | |
1533 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1534 | + ConvSJIStoUTF8N(&cInfo2); | |
1535 | + break; | |
1536 | + } | |
1537 | + break; | |
1538 | + case KANJI_EUC: | |
1539 | + switch(Pkt->KanjiCodeDesired) | |
1540 | + { | |
1541 | + case KANJI_SJIS: | |
1542 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1543 | + cInfo2.OutLen = cInfo.OutLen; | |
1544 | + break; | |
1545 | + case KANJI_JIS: | |
1546 | + cInfo2.Str = cInfo.Buf; | |
1547 | + cInfo2.StrLen = cInfo.OutLen; | |
1548 | + cInfo2.Buf = Buf3; | |
1549 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1550 | + ConvSJIStoJIS(&cInfo2); | |
1551 | + break; | |
1552 | + case KANJI_EUC: | |
1553 | + // JiÏ·Ì½ß | |
1554 | + cInfo2.Str = cInfo.Buf; | |
1555 | + cInfo2.StrLen = cInfo.OutLen; | |
1556 | + cInfo2.Buf = Buf3; | |
1557 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1558 | + ConvSJIStoEUC(&cInfo2); | |
1559 | + break; | |
1560 | + case KANJI_UTF8N: | |
1561 | + cInfo2.Str = cInfo.Buf; | |
1562 | + cInfo2.StrLen = cInfo.OutLen; | |
1563 | + cInfo2.Buf = Buf3; | |
1564 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1565 | + ConvSJIStoUTF8N(&cInfo2); | |
1566 | + break; | |
1567 | + } | |
1568 | + break; | |
1569 | + case KANJI_UTF8N: | |
1570 | + switch(Pkt->KanjiCodeDesired) | |
1571 | + { | |
1572 | + case KANJI_SJIS: | |
1573 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1574 | + cInfo2.OutLen = cInfo.OutLen; | |
1575 | + break; | |
1576 | + case KANJI_JIS: | |
1577 | + cInfo2.Str = cInfo.Buf; | |
1578 | + cInfo2.StrLen = cInfo.OutLen; | |
1579 | + cInfo2.Buf = Buf3; | |
1580 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1581 | + ConvSJIStoJIS(&cInfo2); | |
1582 | + break; | |
1583 | + case KANJI_EUC: | |
1584 | + cInfo2.Str = cInfo.Buf; | |
1585 | + cInfo2.StrLen = cInfo.OutLen; | |
1586 | + cInfo2.Buf = Buf3; | |
1587 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1588 | + ConvSJIStoEUC(&cInfo2); | |
1589 | + break; | |
1590 | + case KANJI_UTF8N: | |
1591 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
1592 | + cInfo2.OutLen = cInfo.OutLen; | |
1593 | + break; | |
1594 | + } | |
1595 | + break; | |
1596 | + } | |
1597 | +// if(WriteFile(iFileHandle, Buf2, cInfo.OutLen, &Writed, NULL) == FALSE) | |
1598 | + if(WriteFile(iFileHandle, Buf3, cInfo2.OutLen, &Writed, NULL) == FALSE) | |
1599 | + Pkt->Abort = ABORT_DISKFULL; | |
1600 | + cInfo2.Buf = Buf3; | |
1601 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
1602 | + FlushRestData(&cInfo2); | |
1603 | + if(WriteFile(iFileHandle, Buf3, cInfo2.OutLen, &Writed, NULL) == FALSE) | |
1429 | 1604 | Pkt->Abort = ABORT_DISKFULL; |
1430 | 1605 | } |
1431 | 1606 |
@@ -1981,6 +2156,8 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
1981 | 2156 | FILE_SHARE_READ|FILE_SHARE_WRITE, &Sec, OPEN_EXISTING, 0, NULL)) != INVALID_HANDLE_VALUE) |
1982 | 2157 | { |
1983 | 2158 | // UTF-8Î |
2159 | + char Buf3[(BUFSIZE + 3) * 4]; | |
2160 | + CODECONVINFO cInfo2; | |
1984 | 2161 | int ProcessedBOM = NO; |
1985 | 2162 | if(Pkt->hWndTrans != NULL) |
1986 | 2163 | { |
@@ -2000,6 +2177,9 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2000 | 2177 | cInfo.KanaCnv = Pkt->KanaCnv; |
2001 | 2178 | InitTermCodeConvInfo(&tInfo); |
2002 | 2179 | |
2180 | + InitCodeConvInfo(&cInfo2); | |
2181 | + cInfo2.KanaCnv = Pkt->KanaCnv; | |
2182 | + | |
2003 | 2183 | /*===== t@CðM·é[v =====*/ |
2004 | 2184 | while((Pkt->Abort == ABORT_NONE) && |
2005 | 2185 | (ForceAbort == NO) && |
@@ -2031,21 +2211,32 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2031 | 2211 | // Continue = ConvSJIStoJIS(&cInfo); |
2032 | 2212 | // else |
2033 | 2213 | // Continue = ConvSJIStoEUC(&cInfo); |
2034 | - char Buf3[(BUFSIZE + 3) * 4]; | |
2035 | - CODECONVINFO cInfo2; | |
2036 | 2214 | switch(Pkt->KanjiCodeDesired) |
2037 | 2215 | { |
2038 | 2216 | case KANJI_SJIS: |
2039 | 2217 | switch(Pkt->KanjiCode) |
2040 | 2218 | { |
2041 | 2219 | case KANJI_SJIS: |
2042 | - memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
2043 | - cInfo2.OutLen = cInfo.StrLen; | |
2044 | - Continue = NO; | |
2220 | +// memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
2221 | +// cInfo2.OutLen = cInfo.StrLen; | |
2222 | +// Continue = NO; | |
2223 | + // JiÏ·Ì½ß | |
2224 | + Continue = ConvSJIStoJIS(&cInfo); | |
2225 | + cInfo2.Str = cInfo.Buf; | |
2226 | + cInfo2.StrLen = cInfo.OutLen; | |
2227 | + cInfo2.Buf = Buf3; | |
2228 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2229 | + ConvJIStoSJIS(&cInfo2); | |
2045 | 2230 | break; |
2046 | 2231 | case KANJI_JIS: |
2232 | + Continue = ConvSJIStoJIS(&cInfo); | |
2233 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2234 | + cInfo2.OutLen = cInfo.OutLen; | |
2047 | 2235 | break; |
2048 | 2236 | case KANJI_EUC: |
2237 | + Continue = ConvSJIStoEUC(&cInfo); | |
2238 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2239 | + cInfo2.OutLen = cInfo.OutLen; | |
2049 | 2240 | break; |
2050 | 2241 | case KANJI_UTF8N: |
2051 | 2242 | if(ProcessedBOM == NO) |
@@ -2057,7 +2248,7 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2057 | 2248 | break; |
2058 | 2249 | } |
2059 | 2250 | Continue = ConvSJIStoUTF8N(&cInfo); |
2060 | - memcpy(Buf3, cInfo.Str, cInfo.OutLen); | |
2251 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2061 | 2252 | cInfo2.OutLen = cInfo.OutLen; |
2062 | 2253 | break; |
2063 | 2254 | } |
@@ -2067,15 +2258,28 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2067 | 2258 | { |
2068 | 2259 | case KANJI_SJIS: |
2069 | 2260 | Continue = ConvJIStoSJIS(&cInfo); |
2070 | - memcpy(Buf3, Buf2, cInfo.OutLen); | |
2261 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2071 | 2262 | cInfo2.OutLen = cInfo.OutLen; |
2072 | 2263 | break; |
2073 | 2264 | case KANJI_JIS: |
2074 | - memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
2075 | - cInfo2.OutLen = cInfo.StrLen; | |
2076 | - Continue = NO; | |
2265 | +// memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
2266 | +// cInfo2.OutLen = cInfo.StrLen; | |
2267 | +// Continue = NO; | |
2268 | + // JiÏ·Ì½ß | |
2269 | + Continue = ConvJIStoSJIS(&cInfo); | |
2270 | + cInfo2.Str = cInfo.Buf; | |
2271 | + cInfo2.StrLen = cInfo.OutLen; | |
2272 | + cInfo2.Buf = Buf3; | |
2273 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2274 | + ConvSJIStoJIS(&cInfo2); | |
2077 | 2275 | break; |
2078 | 2276 | case KANJI_EUC: |
2277 | + Continue = ConvJIStoSJIS(&cInfo); | |
2278 | + cInfo2.Str = cInfo.Buf; | |
2279 | + cInfo2.StrLen = cInfo.OutLen; | |
2280 | + cInfo2.Buf = Buf3; | |
2281 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2282 | + ConvSJIStoEUC(&cInfo2); | |
2079 | 2283 | break; |
2080 | 2284 | case KANJI_UTF8N: |
2081 | 2285 | if(ProcessedBOM == NO) |
@@ -2087,8 +2291,6 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2087 | 2291 | break; |
2088 | 2292 | } |
2089 | 2293 | Continue = ConvJIStoSJIS(&cInfo); |
2090 | - InitCodeConvInfo(&cInfo2); | |
2091 | - cInfo2.KanaCnv = NO; | |
2092 | 2294 | cInfo2.Str = cInfo.Buf; |
2093 | 2295 | cInfo2.StrLen = cInfo.OutLen; |
2094 | 2296 | cInfo2.Buf = Buf3; |
@@ -2102,15 +2304,28 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2102 | 2304 | { |
2103 | 2305 | case KANJI_SJIS: |
2104 | 2306 | Continue = ConvEUCtoSJIS(&cInfo); |
2105 | - memcpy(Buf3, Buf2, cInfo.OutLen); | |
2307 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2106 | 2308 | cInfo2.OutLen = cInfo.OutLen; |
2107 | 2309 | break; |
2108 | 2310 | case KANJI_JIS: |
2311 | + Continue = ConvEUCtoSJIS(&cInfo); | |
2312 | + cInfo2.Str = cInfo.Buf; | |
2313 | + cInfo2.StrLen = cInfo.OutLen; | |
2314 | + cInfo2.Buf = Buf3; | |
2315 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2316 | + ConvSJIStoJIS(&cInfo2); | |
2109 | 2317 | break; |
2110 | 2318 | case KANJI_EUC: |
2111 | - memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
2112 | - cInfo2.OutLen = cInfo.StrLen; | |
2113 | - Continue = NO; | |
2319 | +// memcpy(Buf3, cInfo.Str, cInfo.StrLen); | |
2320 | +// cInfo2.OutLen = cInfo.StrLen; | |
2321 | +// Continue = NO; | |
2322 | + // JiÏ·Ì½ß | |
2323 | + Continue = ConvEUCtoSJIS(&cInfo); | |
2324 | + cInfo2.Str = cInfo.Buf; | |
2325 | + cInfo2.StrLen = cInfo.OutLen; | |
2326 | + cInfo2.Buf = Buf3; | |
2327 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2328 | + ConvSJIStoEUC(&cInfo2); | |
2114 | 2329 | break; |
2115 | 2330 | case KANJI_UTF8N: |
2116 | 2331 | if(ProcessedBOM == NO) |
@@ -2122,8 +2337,6 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2122 | 2337 | break; |
2123 | 2338 | } |
2124 | 2339 | Continue = ConvEUCtoSJIS(&cInfo); |
2125 | - InitCodeConvInfo(&cInfo2); | |
2126 | - cInfo2.KanaCnv = NO; | |
2127 | 2340 | cInfo2.Str = cInfo.Buf; |
2128 | 2341 | cInfo2.StrLen = cInfo.OutLen; |
2129 | 2342 | cInfo2.Buf = Buf3; |
@@ -2156,12 +2369,24 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2156 | 2369 | { |
2157 | 2370 | case KANJI_SJIS: |
2158 | 2371 | Continue = ConvUTF8NtoSJIS(&cInfo); |
2159 | - memcpy(Buf3, Buf2, cInfo.OutLen); | |
2372 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2160 | 2373 | cInfo2.OutLen = cInfo.OutLen; |
2161 | 2374 | break; |
2162 | 2375 | case KANJI_JIS: |
2376 | + Continue = ConvUTF8NtoSJIS(&cInfo); | |
2377 | + cInfo2.Str = cInfo.Buf; | |
2378 | + cInfo2.StrLen = cInfo.OutLen; | |
2379 | + cInfo2.Buf = Buf3; | |
2380 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2381 | + ConvSJIStoJIS(&cInfo2); | |
2163 | 2382 | break; |
2164 | 2383 | case KANJI_EUC: |
2384 | + Continue = ConvUTF8NtoSJIS(&cInfo); | |
2385 | + cInfo2.Str = cInfo.Buf; | |
2386 | + cInfo2.StrLen = cInfo.OutLen; | |
2387 | + cInfo2.Buf = Buf3; | |
2388 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2389 | + ConvSJIStoEUC(&cInfo2); | |
2165 | 2390 | break; |
2166 | 2391 | case KANJI_UTF8N: |
2167 | 2392 | memcpy(Buf3, cInfo.Str, cInfo.StrLen); |
@@ -2206,8 +2431,131 @@ static int UpLoadFile(TRANSPACKET *Pkt, SOCKET dSkt) | ||
2206 | 2431 | cInfo.Buf = Buf2; |
2207 | 2432 | cInfo.BufSize = BUFSIZE+3; |
2208 | 2433 | FlushRestData(&cInfo); |
2434 | + switch(Pkt->KanjiCodeDesired) | |
2435 | + { | |
2436 | + case KANJI_SJIS: | |
2437 | + switch(Pkt->KanjiCode) | |
2438 | + { | |
2439 | + case KANJI_SJIS: | |
2440 | + // JiÏ·Ì½ß | |
2441 | + cInfo2.Str = cInfo.Buf; | |
2442 | + cInfo2.StrLen = cInfo.OutLen; | |
2443 | + cInfo2.Buf = Buf3; | |
2444 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2445 | + ConvJIStoSJIS(&cInfo2); | |
2446 | + break; | |
2447 | + case KANJI_JIS: | |
2448 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2449 | + cInfo2.OutLen = cInfo.OutLen; | |
2450 | + break; | |
2451 | + case KANJI_EUC: | |
2452 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2453 | + cInfo2.OutLen = cInfo.OutLen; | |
2454 | + break; | |
2455 | + case KANJI_UTF8N: | |
2456 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2457 | + cInfo2.OutLen = cInfo.OutLen; | |
2458 | + break; | |
2459 | + } | |
2460 | + break; | |
2461 | + case KANJI_JIS: | |
2462 | + switch(Pkt->KanjiCode) | |
2463 | + { | |
2464 | + case KANJI_SJIS: | |
2465 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2466 | + cInfo2.OutLen = cInfo.OutLen; | |
2467 | + break; | |
2468 | + case KANJI_JIS: | |
2469 | + // JiÏ·Ì½ß | |
2470 | + cInfo2.Str = cInfo.Buf; | |
2471 | + cInfo2.StrLen = cInfo.OutLen; | |
2472 | + cInfo2.Buf = Buf3; | |
2473 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2474 | + ConvSJIStoJIS(&cInfo2); | |
2475 | + break; | |
2476 | + case KANJI_EUC: | |
2477 | + cInfo2.Str = cInfo.Buf; | |
2478 | + cInfo2.StrLen = cInfo.OutLen; | |
2479 | + cInfo2.Buf = Buf3; | |
2480 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2481 | + ConvSJIStoEUC(&cInfo2); | |
2482 | + break; | |
2483 | + case KANJI_UTF8N: | |
2484 | + cInfo2.Str = cInfo.Buf; | |
2485 | + cInfo2.StrLen = cInfo.OutLen; | |
2486 | + cInfo2.Buf = Buf3; | |
2487 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2488 | + ConvSJIStoUTF8N(&cInfo2); | |
2489 | + break; | |
2490 | + } | |
2491 | + break; | |
2492 | + case KANJI_EUC: | |
2493 | + switch(Pkt->KanjiCode) | |
2494 | + { | |
2495 | + case KANJI_SJIS: | |
2496 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2497 | + cInfo2.OutLen = cInfo.OutLen; | |
2498 | + break; | |
2499 | + case KANJI_JIS: | |
2500 | + cInfo2.Str = cInfo.Buf; | |
2501 | + cInfo2.StrLen = cInfo.OutLen; | |
2502 | + cInfo2.Buf = Buf3; | |
2503 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2504 | + ConvSJIStoJIS(&cInfo2); | |
2505 | + break; | |
2506 | + case KANJI_EUC: | |
2507 | + // JiÏ·Ì½ß | |
2508 | + cInfo2.Str = cInfo.Buf; | |
2509 | + cInfo2.StrLen = cInfo.OutLen; | |
2510 | + cInfo2.Buf = Buf3; | |
2511 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2512 | + ConvSJIStoEUC(&cInfo2); | |
2513 | + break; | |
2514 | + case KANJI_UTF8N: | |
2515 | + cInfo2.Str = cInfo.Buf; | |
2516 | + cInfo2.StrLen = cInfo.OutLen; | |
2517 | + cInfo2.Buf = Buf3; | |
2518 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2519 | + ConvSJIStoUTF8N(&cInfo2); | |
2520 | + break; | |
2521 | + } | |
2522 | + break; | |
2523 | + case KANJI_UTF8N: | |
2524 | + switch(Pkt->KanjiCode) | |
2525 | + { | |
2526 | + case KANJI_SJIS: | |
2527 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2528 | + cInfo2.OutLen = cInfo.OutLen; | |
2529 | + break; | |
2530 | + case KANJI_JIS: | |
2531 | + cInfo2.Str = cInfo.Buf; | |
2532 | + cInfo2.StrLen = cInfo.OutLen; | |
2533 | + cInfo2.Buf = Buf3; | |
2534 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2535 | + ConvSJIStoJIS(&cInfo2); | |
2536 | + break; | |
2537 | + case KANJI_EUC: | |
2538 | + cInfo2.Str = cInfo.Buf; | |
2539 | + cInfo2.StrLen = cInfo.OutLen; | |
2540 | + cInfo2.Buf = Buf3; | |
2541 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2542 | + ConvSJIStoEUC(&cInfo2); | |
2543 | + break; | |
2544 | + case KANJI_UTF8N: | |
2545 | + memcpy(Buf3, cInfo.Buf, cInfo.OutLen); | |
2546 | + cInfo2.OutLen = cInfo.OutLen; | |
2547 | + break; | |
2548 | + } | |
2549 | + break; | |
2550 | + } | |
2209 | 2551 | |
2210 | - if(TermCodeConvAndSend(&tInfo, dSkt, Buf2, cInfo.OutLen, Pkt->Type) == FAIL) | |
2552 | +// if(TermCodeConvAndSend(&tInfo, dSkt, Buf2, cInfo.OutLen, Pkt->Type) == FAIL) | |
2553 | + if(TermCodeConvAndSend(&tInfo, dSkt, Buf3, cInfo2.OutLen, Pkt->Type) == FAIL) | |
2554 | + Pkt->Abort = ABORT_ERROR; | |
2555 | + cInfo2.Buf = Buf3; | |
2556 | + cInfo2.BufSize = (BUFSIZE + 3) * 4; | |
2557 | + FlushRestData(&cInfo2); | |
2558 | + if(TermCodeConvAndSend(&tInfo, dSkt, Buf3, cInfo2.OutLen, Pkt->Type) == FAIL) | |
2211 | 2559 | Pkt->Abort = ABORT_ERROR; |
2212 | 2560 | } |
2213 | 2561 |
@@ -2571,12 +2919,17 @@ static void DispTransFileInfo(TRANSPACKET *Pkt, char *Title, int SkipButton, int | ||
2571 | 2919 | else if(Pkt->Type == TYPE_A) |
2572 | 2920 | SendDlgItemMessage(Pkt->hWndTrans, TRANS_MODE, WM_SETTEXT, 0, (LPARAM)MSGJPN120); |
2573 | 2921 | |
2922 | + // UTF-8Î | |
2574 | 2923 | if(Pkt->KanjiCode == KANJI_NOCNV) |
2575 | 2924 | SendDlgItemMessage(Pkt->hWndTrans, TRANS_KANJI, WM_SETTEXT, 0, (LPARAM)MSGJPN121); |
2925 | + else if(Pkt->KanjiCode == KANJI_SJIS) | |
2926 | + SendDlgItemMessage(Pkt->hWndTrans, TRANS_KANJI, WM_SETTEXT, 0, (LPARAM)MSGJPN305); | |
2576 | 2927 | else if(Pkt->KanjiCode == KANJI_JIS) |
2577 | 2928 | SendDlgItemMessage(Pkt->hWndTrans, TRANS_KANJI, WM_SETTEXT, 0, (LPARAM)MSGJPN122); |
2578 | 2929 | else if(Pkt->KanjiCode == KANJI_EUC) |
2579 | 2930 | SendDlgItemMessage(Pkt->hWndTrans, TRANS_KANJI, WM_SETTEXT, 0, (LPARAM)MSGJPN123); |
2931 | + else if(Pkt->KanjiCode == KANJI_UTF8N) | |
2932 | + SendDlgItemMessage(Pkt->hWndTrans, TRANS_KANJI, WM_SETTEXT, 0, (LPARAM)MSGJPN306); | |
2580 | 2933 | } |
2581 | 2934 | else |
2582 | 2935 | { |
@@ -2668,14 +3021,28 @@ static int IsSpecialDevice(char *Fname) | ||
2668 | 3021 | int Sts; |
2669 | 3022 | |
2670 | 3023 | Sts = NO; |
2671 | - if((_stricmp(Fname, "CON") == 0) || | |
2672 | - (_stricmp(Fname, "PRN") == 0) || | |
2673 | - (_stricmp(Fname, "AUX") == 0) || | |
2674 | - (_strnicmp(Fname, "CON.", 4) == 0) || | |
2675 | - (_strnicmp(Fname, "PRN.", 4) == 0) || | |
2676 | - (_strnicmp(Fname, "AUX.", 4) == 0)) | |
3024 | + // oOC³ | |
3025 | +// if((_stricmp(Fname, "CON") == 0) || | |
3026 | +// (_stricmp(Fname, "PRN") == 0) || | |
3027 | +// (_stricmp(Fname, "AUX") == 0) || | |
3028 | +// (_strnicmp(Fname, "CON.", 4) == 0) || | |
3029 | +// (_strnicmp(Fname, "PRN.", 4) == 0) || | |
3030 | +// (_strnicmp(Fname, "AUX.", 4) == 0)) | |
3031 | +// { | |
3032 | +// Sts = YES; | |
3033 | +// } | |
3034 | + if(_strnicmp(Fname, "AUX", 3) == 0|| _strnicmp(Fname, "CON", 3) == 0 || _strnicmp(Fname, "NUL", 3) == 0 || _strnicmp(Fname, "PRN", 3) == 0) | |
3035 | + { | |
3036 | + if(*(Fname + 3) == '\0' || *(Fname + 3) == '.') | |
3037 | + Sts = YES; | |
3038 | + } | |
3039 | + else if(_strnicmp(Fname, "COM", 3) == 0 || _strnicmp(Fname, "LPT", 3) == 0) | |
2677 | 3040 | { |
2678 | - Sts = YES; | |
3041 | + if(isdigit(*(Fname + 3)) != 0) | |
3042 | + { | |
3043 | + if(*(Fname + 4) == '\0' || *(Fname + 4) == '.') | |
3044 | + Sts = YES; | |
3045 | + } | |
2679 | 3046 | } |
2680 | 3047 | return(Sts); |
2681 | 3048 | } |
@@ -1308,7 +1308,7 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA | ||
1308 | 1308 | break; |
1309 | 1309 | |
1310 | 1310 | case MENU_KNJ_SJIS : |
1311 | - lpttt->lpszText = MSGJPN305; | |
1311 | + lpttt->lpszText = MSGJPN307; | |
1312 | 1312 | break; |
1313 | 1313 | |
1314 | 1314 | case MENU_KNJ_EUC : |
@@ -1320,7 +1320,7 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA | ||
1320 | 1320 | break; |
1321 | 1321 | |
1322 | 1322 | case MENU_KNJ_UTF8N : |
1323 | - lpttt->lpszText = MSGJPN306; | |
1323 | + lpttt->lpszText = MSGJPN308; | |
1324 | 1324 | break; |
1325 | 1325 | |
1326 | 1326 | case MENU_KNJ_NONE : |
@@ -1328,19 +1328,19 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA | ||
1328 | 1328 | break; |
1329 | 1329 | |
1330 | 1330 | case MENU_L_KNJ_SJIS : |
1331 | - lpttt->lpszText = MSGJPN307; | |
1331 | + lpttt->lpszText = MSGJPN309; | |
1332 | 1332 | break; |
1333 | 1333 | |
1334 | 1334 | case MENU_L_KNJ_EUC : |
1335 | - lpttt->lpszText = MSGJPN308; | |
1335 | + lpttt->lpszText = MSGJPN310; | |
1336 | 1336 | break; |
1337 | 1337 | |
1338 | 1338 | case MENU_L_KNJ_JIS : |
1339 | - lpttt->lpszText = MSGJPN309; | |
1339 | + lpttt->lpszText = MSGJPN311; | |
1340 | 1340 | break; |
1341 | 1341 | |
1342 | 1342 | case MENU_L_KNJ_UTF8N : |
1343 | - lpttt->lpszText = MSGJPN310; | |
1343 | + lpttt->lpszText = MSGJPN312; | |
1344 | 1344 | break; |
1345 | 1345 | |
1346 | 1346 | case MENU_KANACNV : |
@@ -1937,6 +1937,7 @@ void DoubleClickProc(int Win, int Mode, int App) | ||
1937 | 1937 | MainTransPkt.Type = AskTransferTypeAssoc(MainTransPkt.RemoteFile, AskTransferType()); |
1938 | 1938 | MainTransPkt.Size = 1; |
1939 | 1939 | MainTransPkt.KanjiCode = AskHostKanjiCode(); |
1940 | + MainTransPkt.KanjiCodeDesired = AskLocalKanjiCode(); | |
1940 | 1941 | MainTransPkt.KanaCnv = AskHostKanaCnv(); |
1941 | 1942 | MainTransPkt.Mode = EXIST_OVW; |
1942 | 1943 | MainTransPkt.ExistSize = 0; |
@@ -393,7 +393,7 @@ START_ROUTINE | ||
393 | 393 | break; |
394 | 394 | default: |
395 | 395 | GetClassNameW(hWnd, ClassName, sizeof(ClassName) / sizeof(wchar_t)); |
396 | - if(wcsicmp(ClassName, WC_EDITW) == 0) | |
396 | + if(_wcsicmp(ClassName, WC_EDITW) == 0) | |
397 | 397 | { |
398 | 398 | switch(Msg) |
399 | 399 | { |
@@ -406,7 +406,7 @@ START_ROUTINE | ||
406 | 406 | break; |
407 | 407 | } |
408 | 408 | } |
409 | - else if(wcsicmp(ClassName, WC_COMBOBOXW) == 0) | |
409 | + else if(_wcsicmp(ClassName, WC_COMBOBOXW) == 0) | |
410 | 410 | { |
411 | 411 | switch(Msg) |
412 | 412 | { |
@@ -427,7 +427,7 @@ START_ROUTINE | ||
427 | 427 | break; |
428 | 428 | } |
429 | 429 | } |
430 | - else if(wcsicmp(ClassName, WC_LISTBOXW) == 0) | |
430 | + else if(_wcsicmp(ClassName, WC_LISTBOXW) == 0) | |
431 | 431 | { |
432 | 432 | switch(Msg) |
433 | 433 | { |
@@ -452,7 +452,7 @@ START_ROUTINE | ||
452 | 452 | break; |
453 | 453 | } |
454 | 454 | } |
455 | - else if(wcsicmp(ClassName, WC_LISTVIEWW) == 0) | |
455 | + else if(_wcsicmp(ClassName, WC_LISTVIEWW) == 0) | |
456 | 456 | { |
457 | 457 | switch(Msg) |
458 | 458 | { |
@@ -568,7 +568,7 @@ START_ROUTINE | ||
568 | 568 | break; |
569 | 569 | } |
570 | 570 | } |
571 | - else if(wcsicmp(ClassName, STATUSCLASSNAMEW) == 0) | |
571 | + else if(_wcsicmp(ClassName, STATUSCLASSNAMEW) == 0) | |
572 | 572 | { |
573 | 573 | switch(Msg) |
574 | 574 | { |
@@ -733,13 +733,36 @@ LSTATUS RegQueryValueExM(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, LPDW | ||
733 | 733 | { |
734 | 734 | LSTATUS r = 0; |
735 | 735 | wchar_t* pw0 = NULL; |
736 | + wchar_t* pw1 = NULL; | |
737 | + DWORD dwType; | |
738 | + DWORD wcbData; | |
736 | 739 | START_ROUTINE |
737 | 740 | pw0 = DuplicateMtoW(lpValueName, -1); |
738 | - // TODO: WXgÍUTF-8ÅÛ¶³êĵܤiÈOÌo[WÆÝ·«Èµj | |
739 | - // UTF-16ÅÛ¶·é׫ | |
740 | - r = RegQueryValueExW(hKey, pw0, lpReserved, lpType, lpData, lpcbData); | |
741 | + if(RegQueryValueExW(hKey, pw0, NULL, &dwType, NULL, 0) == ERROR_SUCCESS) | |
742 | + { | |
743 | + switch(dwType) | |
744 | + { | |
745 | + case REG_SZ: | |
746 | + case REG_EXPAND_SZ: | |
747 | + case REG_MULTI_SZ: | |
748 | + if(lpData && lpcbData) | |
749 | + { | |
750 | + pw1 = AllocateStringW(*lpcbData / sizeof(char) * 4); | |
751 | + wcbData = *lpcbData / sizeof(char) * 4; | |
752 | + r = RegQueryValueExW(hKey, pw0, lpReserved, lpType, (LPBYTE)pw1, &wcbData); | |
753 | + *lpcbData = sizeof(char) * WtoM((char*)lpData, *lpcbData / sizeof(char), pw1, wcbData / sizeof(wchar_t)); | |
754 | + } | |
755 | + break; | |
756 | + default: | |
757 | + r = RegQueryValueExW(hKey, pw0, lpReserved, lpType, lpData, lpcbData); | |
758 | + break; | |
759 | + } | |
760 | + } | |
761 | + else | |
762 | + r = RegQueryValueExW(hKey, pw0, lpReserved, lpType, lpData, lpcbData); | |
741 | 763 | END_ROUTINE |
742 | 764 | FreeDuplicatedString(pw0); |
765 | + FreeDuplicatedString(pw1); | |
743 | 766 | return r; |
744 | 767 | } |
745 | 768 |
@@ -747,13 +770,27 @@ LSTATUS RegSetValueExM(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwTy | ||
747 | 770 | { |
748 | 771 | LSTATUS r = 0; |
749 | 772 | wchar_t* pw0 = NULL; |
773 | + wchar_t* pw1 = NULL; | |
774 | + DWORD wcbData; | |
750 | 775 | START_ROUTINE |
751 | 776 | pw0 = DuplicateMtoW(lpValueName, -1); |
752 | - // TODO: WXgÍUTF-8ÅÛ¶³êĵܤiÈOÌo[WÆÝ·«Èµj | |
753 | - // UTF-16ÅÛ¶·é׫ | |
777 | + switch(dwType) | |
778 | + { | |
779 | + case REG_SZ: | |
780 | + case REG_EXPAND_SZ: | |
781 | + case REG_MULTI_SZ: | |
782 | + wcbData = MtoW(NULL, 0, (char*)lpData, cbData / sizeof(char)); | |
783 | + pw1 = AllocateStringW(wcbData); | |
784 | + MtoW(pw1, wcbData, (char*)lpData, cbData / sizeof(char)); | |
785 | + wcbData = sizeof(wchar_t) * wcbData; | |
786 | + lpData = (BYTE*)pw1; | |
787 | + cbData = wcbData; | |
788 | + break; | |
789 | + } | |
754 | 790 | r = RegSetValueExW(hKey, pw0, Reserved, dwType, lpData, cbData); |
755 | 791 | END_ROUTINE |
756 | 792 | FreeDuplicatedString(pw0); |
793 | + FreeDuplicatedString(pw1); | |
757 | 794 | return r; |
758 | 795 | } |
759 | 796 |
@@ -974,7 +1011,7 @@ END_ROUTINE | ||
974 | 1011 | |
975 | 1012 | HWND HtmlHelpM(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD_PTR dwData) |
976 | 1013 | { |
977 | - HINSTANCE r = NULL; | |
1014 | + HWND r = NULL; | |
978 | 1015 | wchar_t* pw0 = NULL; |
979 | 1016 | START_ROUTINE |
980 | 1017 | pw0 = DuplicateMtoW(pszFile, -1); |
@@ -984,6 +1021,76 @@ END_ROUTINE | ||
984 | 1021 | return r; |
985 | 1022 | } |
986 | 1023 | |
1024 | +BOOL CreateProcessM(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) | |
1025 | +{ | |
1026 | + BOOL r = FALSE; | |
1027 | + wchar_t* pw0 = NULL; | |
1028 | + wchar_t* pw1 = NULL; | |
1029 | + wchar_t* pw2 = NULL; | |
1030 | + wchar_t* pw3 = NULL; | |
1031 | + wchar_t* pw4 = NULL; | |
1032 | + wchar_t* pw5 = NULL; | |
1033 | + STARTUPINFOW wStartupInfo; | |
1034 | +START_ROUTINE | |
1035 | + pw0 = DuplicateMtoW(lpApplicationName, -1); | |
1036 | + pw1 = DuplicateMtoWBuffer(lpCommandLine, -1, (strlen(lpCommandLine) + 1) * 4); | |
1037 | + pw2 = DuplicateMtoW(lpCurrentDirectory, -1); | |
1038 | + wStartupInfo.cb = sizeof(LPSTARTUPINFOW); | |
1039 | + pw3 = DuplicateMtoW(lpStartupInfo->lpReserved, -1); | |
1040 | + wStartupInfo.lpReserved = pw3; | |
1041 | + pw4 = DuplicateMtoW(lpStartupInfo->lpDesktop, -1); | |
1042 | + wStartupInfo.lpDesktop = pw4; | |
1043 | + pw5 = DuplicateMtoW(lpStartupInfo->lpTitle, -1); | |
1044 | + wStartupInfo.lpTitle = pw5; | |
1045 | + wStartupInfo.dwX = lpStartupInfo->dwX; | |
1046 | + wStartupInfo.dwY = lpStartupInfo->dwY; | |
1047 | + wStartupInfo.dwXSize = lpStartupInfo->dwXSize; | |
1048 | + wStartupInfo.dwYSize = lpStartupInfo->dwYSize; | |
1049 | + wStartupInfo.dwXCountChars = lpStartupInfo->dwXCountChars; | |
1050 | + wStartupInfo.dwYCountChars = lpStartupInfo->dwYCountChars; | |
1051 | + wStartupInfo.dwFillAttribute = lpStartupInfo->dwFillAttribute; | |
1052 | + wStartupInfo.dwFlags = lpStartupInfo->dwFlags; | |
1053 | + wStartupInfo.wShowWindow = lpStartupInfo->wShowWindow; | |
1054 | + wStartupInfo.cbReserved2 = lpStartupInfo->cbReserved2; | |
1055 | + wStartupInfo.lpReserved2 = lpStartupInfo->lpReserved2; | |
1056 | + wStartupInfo.hStdInput = lpStartupInfo->hStdInput; | |
1057 | + wStartupInfo.hStdOutput = lpStartupInfo->hStdOutput; | |
1058 | + wStartupInfo.hStdError = lpStartupInfo->hStdError; | |
1059 | + r = CreateProcessW(pw0, pw1, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, pw2, &wStartupInfo, lpProcessInformation); | |
1060 | + WtoM(lpCommandLine, strlen(lpCommandLine) + 1, pw1, -1); | |
1061 | +END_ROUTINE | |
1062 | + FreeDuplicatedString(pw0); | |
1063 | + FreeDuplicatedString(pw1); | |
1064 | + FreeDuplicatedString(pw2); | |
1065 | + FreeDuplicatedString(pw3); | |
1066 | + FreeDuplicatedString(pw4); | |
1067 | + FreeDuplicatedString(pw5); | |
1068 | + return r; | |
1069 | +} | |
1070 | + | |
1071 | +HINSTANCE FindExecutableM(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult) | |
1072 | +{ | |
1073 | + HINSTANCE r = NULL; | |
1074 | + wchar_t* pw0 = NULL; | |
1075 | + wchar_t* pw1 = NULL; | |
1076 | + wchar_t* pw2 = NULL; | |
1077 | + wchar_t* pw3 = NULL; | |
1078 | +START_ROUTINE | |
1079 | + pw0 = DuplicateMtoW(lpFile, -1); | |
1080 | + pw1 = DuplicateMtoW(lpDirectory, -1); | |
1081 | + pw2 = AllocateStringW(MAX_PATH * 4); | |
1082 | + r = FindExecutableW(pw0, pw1, pw2); | |
1083 | + // obt@·s¾Ì½ßI[o[ÌÂ\« è | |
1084 | + WtoM(lpResult, MAX_PATH, pw2, -1); | |
1085 | + TerminateStringM(lpResult, MAX_PATH); | |
1086 | +END_ROUTINE | |
1087 | + FreeDuplicatedString(pw0); | |
1088 | + FreeDuplicatedString(pw1); | |
1089 | + FreeDuplicatedString(pw2); | |
1090 | + FreeDuplicatedString(pw3); | |
1091 | + return r; | |
1092 | +} | |
1093 | + | |
987 | 1094 | HINSTANCE ShellExecuteM(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd) |
988 | 1095 | { |
989 | 1096 | HINSTANCE r = NULL; |
@@ -1224,7 +1331,17 @@ END_ROUTINE | ||
1224 | 1331 | return r; |
1225 | 1332 | } |
1226 | 1333 | |
1227 | - | |
1334 | +INT_PTR DialogBoxParamM(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam) | |
1335 | +{ | |
1336 | + INT_PTR r = 0; | |
1337 | + wchar_t* pw0 = NULL; | |
1338 | +START_ROUTINE | |
1339 | + pw0 = DuplicateMtoW(lpTemplateName, -1); | |
1340 | + r = DialogBoxParamW(hInstance, pw0, hWndParent, lpDialogFunc, dwInitParam); | |
1341 | +END_ROUTINE | |
1342 | + FreeDuplicatedString(pw0); | |
1343 | + return r; | |
1344 | +} | |
1228 | 1345 | |
1229 | 1346 | |
1230 | 1347 |
@@ -59,6 +59,10 @@ | ||
59 | 59 | #define GetSaveFileName GetSaveFileNameM |
60 | 60 | #undef HtmlHelp |
61 | 61 | #define HtmlHelp HtmlHelpM |
62 | +#undef CreateProcess | |
63 | +#define CreateProcess CreateProcessM | |
64 | +#undef FindExecutable | |
65 | +#define FindExecutable FindExecutableM | |
62 | 66 | #undef ShellExecute |
63 | 67 | #define ShellExecute ShellExecuteM |
64 | 68 | #undef SHBrowseForFolder |
@@ -75,6 +79,8 @@ | ||
75 | 79 | #define CreateFontIndirect CreateFontIndirectM |
76 | 80 | #undef ChooseFont |
77 | 81 | #define ChooseFont ChooseFontM |
82 | +#undef DialogBoxParam | |
83 | +#define DialogBoxParam DialogBoxParamM | |
78 | 84 | |
79 | 85 | #undef CreateWindow |
80 | 86 | #define CreateWindow(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) CreateWindowEx(0L, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) |
@@ -302,9 +302,11 @@ | ||
302 | 302 | #define MSGJPN302 "Master password checker looks broken." |
303 | 303 | #define MSGJPN303 "Master password has been changed." |
304 | 304 | #define MSGJPN304 "Speecified master password is not correct.\r\nAre you sure you want to re-enter?\r\nNo memorized FTP password is available if you choose 'NO'" |
305 | -#define MSGJPN305 "Shift_JIS Kanji Code" | |
306 | -#define MSGJPN306 "UTF-8 Kanji Code" | |
307 | -#define MSGJPN307 "Shift_JIS Kanji Code (Local)" | |
308 | -#define MSGJPN308 "EUC Kanji Code (Local)" | |
309 | -#define MSGJPN309 "JIS Kanji Code (Local)" | |
310 | -#define MSGJPN310 "UTF-8 Kanji Code (Local)" | |
305 | +#define MSGJPN305 "Shift_JIS" | |
306 | +#define MSGJPN306 "UTF-8N" | |
307 | +#define MSGJPN307 "Shift_JIS Kanji Code" | |
308 | +#define MSGJPN308 "UTF-8N Kanji Code" | |
309 | +#define MSGJPN309 "Shift_JIS Kanji Code (Local)" | |
310 | +#define MSGJPN310 "EUC Kanji Code (Local)" | |
311 | +#define MSGJPN311 "JIS Kanji Code (Local)" | |
312 | +#define MSGJPN312 "UTF-8N Kanji Code (Local)" |
@@ -302,9 +302,11 @@ | ||
302 | 302 | #define MSGJPN302 "Master password checker looks broken." |
303 | 303 | #define MSGJPN303 "Master password has been changed." |
304 | 304 | #define MSGJPN304 "Speecified master password is not correct.\r\nAre you sure you want to re-enter?\r\nNo memorized FTP password is available if you choose 'NO'" |
305 | -#define MSGJPN305 "Shift_JIS Kanji Code" | |
306 | -#define MSGJPN306 "UTF-8 Kanji Code" | |
307 | -#define MSGJPN307 "Shift_JIS Kanji Code (Local)" | |
308 | -#define MSGJPN308 "EUC Kanji Code (Local)" | |
309 | -#define MSGJPN309 "JIS Kanji Code (Local)" | |
310 | -#define MSGJPN310 "UTF-8 Kanji Code (Local)" | |
305 | +#define MSGJPN305 "Shift_JIS" | |
306 | +#define MSGJPN306 "UTF-8N" | |
307 | +#define MSGJPN307 "Shift_JIS Kanji Code" | |
308 | +#define MSGJPN308 "UTF-8N Kanji Code" | |
309 | +#define MSGJPN309 "Shift_JIS Kanji Code (Local)" | |
310 | +#define MSGJPN310 "EUC Kanji Code (Local)" | |
311 | +#define MSGJPN311 "JIS Kanji Code (Local)" | |
312 | +#define MSGJPN312 "UTF-8N Kanji Code (Local)" |
@@ -302,9 +302,11 @@ | ||
302 | 302 | #define MSGJPN302 "\xE7\xA2\xBA\xE8\xAA\x8D\xE7\x94\xA8\xE3\x83\x87\xE3\x83\xBC\xE3\x82\xBF\xE3\x81\x8C\xE5\xA3\x8A\xE3\x82\x8C\xE3\x81\xA6\xE3\x81\x84\xE3\x82\x8B\xE3\x81\x9F\xE3\x82\x81\xEF\xBC\x8C\xE3\x83\x9E\xE3\x82\xB9\xE3\x82\xBF\xE3\x83\xBC\xE3\x83\x91\xE3\x82\xB9\xE3\x83\xAF\xE3\x83\xBC\xE3\x83\x89\xE3\x81\xAE\xE6\xAD\xA3\xE5\xBD\x93\xE6\x80\xA7\xE3\x82\x92\xE7\xA2\xBA\xE8\xAA\x8D\xE3\x81\xA7\xE3\x81\x8D\xE3\x81\xBE\xE3\x81\x9B\xE3\x82\x93\xE3\x81\xA7\xE3\x81\x97\xE3\x81\x9F\xEF\xBC\x8E" |
303 | 303 | #define MSGJPN303 "\xE3\x83\x9E\xE3\x82\xB9\xE3\x82\xBF\xE3\x83\xBC\xE3\x83\x91\xE3\x82\xB9\xE3\x83\xAF\xE3\x83\xBC\xE3\x83\x89\xE3\x82\x92\xE5\xA4\x89\xE6\x9B\xB4\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x97\xE3\x81\x9F" |
304 | 304 | #define MSGJPN304 "\xE6\x8C\x87\xE5\xAE\x9A\xE3\x81\x95\xE3\x82\x8C\xE3\x81\x9F\xE3\x83\x9E\xE3\x82\xB9\xE3\x82\xBF\xE3\x83\xBC\xE3\x83\x91\xE3\x82\xB9\xE3\x83\xAF\xE3\x83\xBC\xE3\x83\x89\xE3\x81\x8C\xE7\x99\xBB\xE9\x8C\xB2\xE3\x81\x95\xE3\x82\x8C\xE3\x81\x9F\xE3\x82\x82\xE3\x81\xAE\xE3\x81\xA8\xE4\xB8\x80\xE8\x87\xB4\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x9B\xE3\x82\x93\xEF\xBC\x8E\r\n\xE5\x86\x8D\xE5\xBA\xA6\xE5\x85\xA5\xE5\x8A\x9B\xE3\x81\x97\xE3\x81\xBE\xE3\x81\x99\xE3\x81\x8B\xEF\xBC\x9F\r\n\xE3\x80\x8C\xE3\x81\x84\xE3\x81\x84\xE3\x81\x88\xE3\x80\x8D\xE3\x82\x92\xE9\x81\xB8\xE3\x81\xB6\xE3\x81\xA8\xE8\xA8\x98\xE6\x86\xB6\xE3\x81\x95\xE3\x82\x8C\xE3\x81\x9F\x46TP\xE3\x83\x91\xE3\x82\xB9\xE3\x83\xAF\xE3\x83\xBC\xE3\x83\x89\xE3\x81\xAF\xE5\x88\xA9\xE7\x94\xA8\xE3\x81\xA7\xE3\x81\x8D\xE3\x81\xBE\xE3\x81\x9B\xE3\x82\x93\xEF\xBC\x8E" |
305 | -#define MSGJPN305 "\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\xAFShift_JIS" | |
306 | -#define MSGJPN306 "\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" | |
307 | -#define MSGJPN307 "\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\xAFShift_JIS" | |
308 | -#define MSGJPN308 "\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\xAF\x45UC" | |
309 | -#define MSGJPN309 "\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\xAFJIS" | |
310 | -#define MSGJPN310 "\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" | |
305 | +#define MSGJPN305 "Shift_JIS" | |
306 | +#define MSGJPN306 "UTF-8N" | |
307 | +#define MSGJPN307 "\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\xAFShift_JIS" | |
308 | +#define MSGJPN308 "\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-8N" | |
309 | +#define MSGJPN309 "\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\xAFShift_JIS" | |
310 | +#define MSGJPN310 "\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\xAF\x45UC" | |
311 | +#define MSGJPN311 "\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\xAFJIS" | |
312 | +#define MSGJPN312 "\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-8N" |
@@ -302,9 +302,11 @@ | ||
302 | 302 | #define MSGJPN302 "mFpf[^ªóêÄ¢é½ßC}X^[pX[h̳«ðmFūܹñŵ½D" |
303 | 303 | #define MSGJPN303 "}X^[pX[hðÏXµÜµ½" |
304 | 304 | #define MSGJPN304 "wè³ê½}X^[pX[hªo^³ê½àÌÆêvµÜ¹ñD\r\nÄxü͵ܷ©H\r\nu¢¢¦vðIÔÆL¯³ê½FTPpX[hÍpūܹñD" |
305 | -#define MSGJPN305 "zXgÌ¿R[hÍShift_JIS" | |
306 | -#define MSGJPN306 "zXgÌ¿R[hÍUTF-8" | |
307 | -#define MSGJPN307 "[JÌ¿R[hÍShift_JIS" | |
308 | -#define MSGJPN308 "[JÌ¿R[hÍEUC" | |
309 | -#define MSGJPN309 "[JÌ¿R[hÍJIS" | |
310 | -#define MSGJPN310 "[JÌ¿R[hÍUTF-8" | |
305 | +#define MSGJPN305 "Shift_JIS" | |
306 | +#define MSGJPN306 "UTF-8N" | |
307 | +#define MSGJPN307 "zXgÌ¿R[hÍShift_JIS" | |
308 | +#define MSGJPN308 "zXgÌ¿R[hÍUTF-8N" | |
309 | +#define MSGJPN309 "[JÌ¿R[hÍShift_JIS" | |
310 | +#define MSGJPN310 "[JÌ¿R[hÍEUC" | |
311 | +#define MSGJPN311 "[JÌ¿R[hÍJIS" | |
312 | +#define MSGJPN312 "[JÌ¿R[hÍUTF-8N" |
@@ -791,6 +791,10 @@ void EnableUserOpe(void) | ||
791 | 791 | EnableWindow(hWndDirLocal, TRUE); |
792 | 792 | EnableWindow(hWndDirRemote, TRUE); |
793 | 793 | |
794 | + // IðsÂÈ¿R[hÌ{^ª\¦³êéoOðC³ | |
795 | + HideHostKanjiButton(); | |
796 | + HideLocalKanjiButton(); | |
797 | + | |
794 | 798 | HideUI = NO; |
795 | 799 | |
796 | 800 | MakeButtonsFocus(); |
@@ -1114,11 +1118,28 @@ void HideHostKanjiButton(void) | ||
1114 | 1118 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_JIS, MAKELONG(TRUE, 0)); |
1115 | 1119 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_UTF8N, MAKELONG(TRUE, 0)); |
1116 | 1120 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_NONE, MAKELONG(TRUE, 0)); |
1117 | - if(TmpHostKanjiCode != KANJI_NOCNV) | |
1118 | - SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(TRUE, 0)); | |
1119 | - else | |
1120 | - SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(FALSE, 0)); | |
1121 | - break; | |
1121 | +// if(TmpHostKanjiCode != KANJI_NOCNV) | |
1122 | +// SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(TRUE, 0)); | |
1123 | +// else | |
1124 | +// SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(FALSE, 0)); | |
1125 | +// break; | |
1126 | + // »ÝJiÏ·ÍShift_JISAJISAEUCÔÅÌÝ@\·é | |
1127 | + SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(FALSE, 0)); | |
1128 | + switch(TmpHostKanjiCode) | |
1129 | + { | |
1130 | + case KANJI_SJIS: | |
1131 | + case KANJI_JIS: | |
1132 | + case KANJI_EUC: | |
1133 | + switch(TmpLocalKanjiCode) | |
1134 | + { | |
1135 | + case KANJI_SJIS: | |
1136 | + case KANJI_JIS: | |
1137 | + case KANJI_EUC: | |
1138 | + SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(TRUE, 0)); | |
1139 | + break; | |
1140 | + } | |
1141 | + break; | |
1142 | + } | |
1122 | 1143 | } |
1123 | 1144 | return; |
1124 | 1145 | } |
@@ -1146,11 +1167,11 @@ void SetLocalKanjiCode(int Type) | ||
1146 | 1167 | break; |
1147 | 1168 | |
1148 | 1169 | case MENU_L_KNJ_EUC : |
1149 | -// TmpLocalKanjiCode = KANJI_EUC; | |
1170 | + TmpLocalKanjiCode = KANJI_EUC; | |
1150 | 1171 | break; |
1151 | 1172 | |
1152 | 1173 | case MENU_L_KNJ_JIS : |
1153 | -// TmpLocalKanjiCode = KANJI_JIS; | |
1174 | + TmpLocalKanjiCode = KANJI_JIS; | |
1154 | 1175 | break; |
1155 | 1176 | |
1156 | 1177 | case MENU_L_KNJ_UTF8N : |
@@ -1172,11 +1193,11 @@ void DispLocalKanjiCode(void) | ||
1172 | 1193 | break; |
1173 | 1194 | |
1174 | 1195 | case KANJI_EUC : |
1175 | -// SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_L_KNJ_EUC, MAKELONG(TRUE, 0)); | |
1196 | + SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_L_KNJ_EUC, MAKELONG(TRUE, 0)); | |
1176 | 1197 | break; |
1177 | 1198 | |
1178 | 1199 | case KANJI_JIS : |
1179 | -// SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_L_KNJ_JIS, MAKELONG(TRUE, 0)); | |
1200 | + SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_L_KNJ_JIS, MAKELONG(TRUE, 0)); | |
1180 | 1201 | break; |
1181 | 1202 | |
1182 | 1203 | case KANJI_UTF8N : |
@@ -1205,12 +1226,26 @@ void HideLocalKanjiButton(void) | ||
1205 | 1226 | |
1206 | 1227 | default : |
1207 | 1228 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_SJIS, MAKELONG(TRUE, 0)); |
1208 | -// SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_EUC, MAKELONG(TRUE, 0)); | |
1209 | -// SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_JIS, MAKELONG(TRUE, 0)); | |
1229 | + SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_EUC, MAKELONG(TRUE, 0)); | |
1230 | + SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_JIS, MAKELONG(TRUE, 0)); | |
1210 | 1231 | SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_UTF8N, MAKELONG(TRUE, 0)); |
1211 | - // TODO: »ÝEUCÆJISÍñÎ | |
1212 | - SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_EUC, MAKELONG(FALSE, 0)); | |
1213 | - SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_JIS, MAKELONG(FALSE, 0)); | |
1232 | + // »ÝJiÏ·ÍShift_JISAJISAEUCÔÅÌÝ@\·é | |
1233 | + SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(FALSE, 0)); | |
1234 | + switch(TmpHostKanjiCode) | |
1235 | + { | |
1236 | + case KANJI_SJIS: | |
1237 | + case KANJI_JIS: | |
1238 | + case KANJI_EUC: | |
1239 | + switch(TmpLocalKanjiCode) | |
1240 | + { | |
1241 | + case KANJI_SJIS: | |
1242 | + case KANJI_JIS: | |
1243 | + case KANJI_EUC: | |
1244 | + SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(TRUE, 0)); | |
1245 | + break; | |
1246 | + } | |
1247 | + break; | |
1248 | + } | |
1214 | 1249 | break; |
1215 | 1250 | } |
1216 | 1251 | return; |