diff -uNBb FileZilla_2_2_24b_src_orig/source/ControlSocket.cpp FileZilla_2_2_24b_src/source/ControlSocket.cpp --- FileZilla_2_2_24b_src_orig/source/ControlSocket.cpp 2006-05-26 17:24:10.000000000 +0900 +++ FileZilla_2_2_24b_src/source/ControlSocket.cpp 2006-06-09 22:53:16.000000000 +0900 @@ -27,7 +27,9 @@ #include "AsyncSslSocketLayer.h" #include "AsyncGssSocketLayer.h" #include "SpeedLimit.h" +#if 0 #include +#endif #ifdef _DEBUG #undef THIS_FILE @@ -518,7 +520,7 @@ CString CControlSocket::ConvertDomainName(CString domain) { USES_CONVERSION; - +#if 0 LPCWSTR buffer = T2CW(domain); char *utf8 = new char[wcslen(buffer) * 2 + 2]; @@ -541,4 +543,6 @@ CString result = A2T(output); free(output); return result; +#endif + return domain; } \ No newline at end of file diff -uNBb FileZilla_2_2_24b_src_orig/source/FileZilla.sln FileZilla_2_2_24b_src/source/FileZilla.sln --- FileZilla_2_2_24b_src_orig/source/FileZilla.sln 2005-03-20 01:51:47.000000000 +0900 +++ FileZilla_2_2_24b_src/source/FileZilla.sln 2006-06-09 22:53:16.000000000 +0900 @@ -92,77 +92,58 @@ {6F21056F-9567-49CD-8D49-45AAFE04B10C}.Debug.ActiveCfg = Release|Win32 {6F21056F-9567-49CD-8D49-45AAFE04B10C}.Debug Unicode.ActiveCfg = Release|Win32 {6F21056F-9567-49CD-8D49-45AAFE04B10C}.Release.ActiveCfg = Release|Win32 - {6F21056F-9567-49CD-8D49-45AAFE04B10C}.Release.Build.0 = Release|Win32 {14929121-DB37-45C1-9FDC-0733C3901333}.Debug.ActiveCfg = Release|Win32 {14929121-DB37-45C1-9FDC-0733C3901333}.Debug Unicode.ActiveCfg = Release|Win32 {14929121-DB37-45C1-9FDC-0733C3901333}.Release.ActiveCfg = Release|Win32 - {14929121-DB37-45C1-9FDC-0733C3901333}.Release.Build.0 = Release|Win32 {8EFCF47C-2BCC-4205-AC85-C782F763590D}.Debug.ActiveCfg = Release|Win32 {8EFCF47C-2BCC-4205-AC85-C782F763590D}.Debug Unicode.ActiveCfg = Release|Win32 {8EFCF47C-2BCC-4205-AC85-C782F763590D}.Release.ActiveCfg = Release|Win32 - {8EFCF47C-2BCC-4205-AC85-C782F763590D}.Release.Build.0 = Release|Win32 {2E49E78F-C2A7-4DA2-B288-281CECA458F9}.Debug.ActiveCfg = Release|Win32 {2E49E78F-C2A7-4DA2-B288-281CECA458F9}.Debug Unicode.ActiveCfg = Release|Win32 {2E49E78F-C2A7-4DA2-B288-281CECA458F9}.Release.ActiveCfg = Release|Win32 - {2E49E78F-C2A7-4DA2-B288-281CECA458F9}.Release.Build.0 = Release|Win32 {633C6475-62C9-42BE-8763-0D3991B5C5D7}.Debug.ActiveCfg = Release|Win32 {633C6475-62C9-42BE-8763-0D3991B5C5D7}.Debug Unicode.ActiveCfg = Release|Win32 {633C6475-62C9-42BE-8763-0D3991B5C5D7}.Release.ActiveCfg = Release|Win32 - {633C6475-62C9-42BE-8763-0D3991B5C5D7}.Release.Build.0 = Release|Win32 {17E16F5E-4E81-4FDF-A100-7BA3D251BBB9}.Debug.ActiveCfg = Release|Win32 {17E16F5E-4E81-4FDF-A100-7BA3D251BBB9}.Debug Unicode.ActiveCfg = Release|Win32 {17E16F5E-4E81-4FDF-A100-7BA3D251BBB9}.Release.ActiveCfg = Release|Win32 - {17E16F5E-4E81-4FDF-A100-7BA3D251BBB9}.Release.Build.0 = Release|Win32 {D6845007-872C-4F8C-A65D-A4DA4B422AEA}.Debug.ActiveCfg = Release|Win32 {D6845007-872C-4F8C-A65D-A4DA4B422AEA}.Debug Unicode.ActiveCfg = Release|Win32 {D6845007-872C-4F8C-A65D-A4DA4B422AEA}.Release.ActiveCfg = Release|Win32 - {D6845007-872C-4F8C-A65D-A4DA4B422AEA}.Release.Build.0 = Release|Win32 {E5CD43CC-6229-45F9-B09B-6FEE5E4B010E}.Debug.ActiveCfg = Release|Win32 {E5CD43CC-6229-45F9-B09B-6FEE5E4B010E}.Debug Unicode.ActiveCfg = Release|Win32 {E5CD43CC-6229-45F9-B09B-6FEE5E4B010E}.Release.ActiveCfg = Release|Win32 - {E5CD43CC-6229-45F9-B09B-6FEE5E4B010E}.Release.Build.0 = Release|Win32 {7A92C9C5-EEB6-43CC-AA2D-3A2D9F0B1B61}.Debug.ActiveCfg = Release|Win32 {7A92C9C5-EEB6-43CC-AA2D-3A2D9F0B1B61}.Debug Unicode.ActiveCfg = Release|Win32 {7A92C9C5-EEB6-43CC-AA2D-3A2D9F0B1B61}.Release.ActiveCfg = Release|Win32 - {7A92C9C5-EEB6-43CC-AA2D-3A2D9F0B1B61}.Release.Build.0 = Release|Win32 {06DD0594-3B97-4A94-8961-D35269A0FAC8}.Debug.ActiveCfg = Release|Win32 {06DD0594-3B97-4A94-8961-D35269A0FAC8}.Debug Unicode.ActiveCfg = Release|Win32 {06DD0594-3B97-4A94-8961-D35269A0FAC8}.Release.ActiveCfg = Release|Win32 - {06DD0594-3B97-4A94-8961-D35269A0FAC8}.Release.Build.0 = Release|Win32 {D0A3379E-17D4-45D1-9C3F-D225C86AF3A0}.Debug.ActiveCfg = Release|Win32 {D0A3379E-17D4-45D1-9C3F-D225C86AF3A0}.Debug Unicode.ActiveCfg = Release|Win32 {D0A3379E-17D4-45D1-9C3F-D225C86AF3A0}.Release.ActiveCfg = Release|Win32 - {D0A3379E-17D4-45D1-9C3F-D225C86AF3A0}.Release.Build.0 = Release|Win32 {29B9AD15-5BB3-4880-BD11-859CF3368CCF}.Debug.ActiveCfg = Release|Win32 {29B9AD15-5BB3-4880-BD11-859CF3368CCF}.Debug Unicode.ActiveCfg = Release|Win32 {29B9AD15-5BB3-4880-BD11-859CF3368CCF}.Release.ActiveCfg = Release|Win32 - {29B9AD15-5BB3-4880-BD11-859CF3368CCF}.Release.Build.0 = Release|Win32 {89D2C764-FAC3-4F24-9D6A-2001FA832B72}.Debug.ActiveCfg = Release|Win32 {89D2C764-FAC3-4F24-9D6A-2001FA832B72}.Debug Unicode.ActiveCfg = Release|Win32 {89D2C764-FAC3-4F24-9D6A-2001FA832B72}.Release.ActiveCfg = Release|Win32 - {89D2C764-FAC3-4F24-9D6A-2001FA832B72}.Release.Build.0 = Release|Win32 {21B5E183-5B28-4DE0-9DBC-67842FDA0BF8}.Debug.ActiveCfg = Release|Win32 - {21B5E183-5B28-4DE0-9DBC-67842FDA0BF8}.Debug.Build.0 = Release|Win32 {21B5E183-5B28-4DE0-9DBC-67842FDA0BF8}.Debug Unicode.ActiveCfg = Release Unicode|Win32 - {21B5E183-5B28-4DE0-9DBC-67842FDA0BF8}.Debug Unicode.Build.0 = Release Unicode|Win32 {21B5E183-5B28-4DE0-9DBC-67842FDA0BF8}.Release.ActiveCfg = Release|Win32 {21B5E183-5B28-4DE0-9DBC-67842FDA0BF8}.Release.Build.0 = Release|Win32 {4448FF75-A85A-4F5B-85B4-94A209C93161}.Debug.ActiveCfg = Release|Win32 {4448FF75-A85A-4F5B-85B4-94A209C93161}.Debug Unicode.ActiveCfg = Release|Win32 {4448FF75-A85A-4F5B-85B4-94A209C93161}.Release.ActiveCfg = Release|Win32 - {4448FF75-A85A-4F5B-85B4-94A209C93161}.Release.Build.0 = Release|Win32 {295602B9-2ECA-44B7-BFAE-71685B734B35}.Debug.ActiveCfg = Release|Win32 {295602B9-2ECA-44B7-BFAE-71685B734B35}.Debug Unicode.ActiveCfg = Release|Win32 {295602B9-2ECA-44B7-BFAE-71685B734B35}.Release.ActiveCfg = Release|Win32 - {295602B9-2ECA-44B7-BFAE-71685B734B35}.Release.Build.0 = Release|Win32 {E95192F3-54D1-433D-BC91-00305EE0B83E}.Debug.ActiveCfg = Release|Win32 {E95192F3-54D1-433D-BC91-00305EE0B83E}.Debug Unicode.ActiveCfg = Release|Win32 {E95192F3-54D1-433D-BC91-00305EE0B83E}.Release.ActiveCfg = Release|Win32 - {E95192F3-54D1-433D-BC91-00305EE0B83E}.Release.Build.0 = Release|Win32 {647F026E-6202-4031-9C24-E5613620B30B}.Debug.ActiveCfg = Release|Win32 {647F026E-6202-4031-9C24-E5613620B30B}.Debug Unicode.ActiveCfg = Release|Win32 {647F026E-6202-4031-9C24-E5613620B30B}.Release.ActiveCfg = Release|Win32 - {647F026E-6202-4031-9C24-E5613620B30B}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection diff -uNBb FileZilla_2_2_24b_src_orig/source/FileZilla.vcproj FileZilla_2_2_24b_src/source/FileZilla.vcproj --- FileZilla_2_2_24b_src_orig/source/FileZilla.vcproj 2006-05-11 18:07:21.000000000 +0900 +++ FileZilla_2_2_24b_src/source/FileZilla.vcproj 2006-06-09 22:53:16.000000000 +0900 @@ -85,7 +85,7 @@ ConfigurationType="1" UseOfMFC="1" ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="1" + CharacterSet="2" WholeProgramOptimization="TRUE"> + + diff -uNBb FileZilla_2_2_24b_src_orig/source/FtpControlSocket.cpp FileZilla_2_2_24b_src/source/FtpControlSocket.cpp --- FileZilla_2_2_24b_src_orig/source/FtpControlSocket.cpp 2006-05-26 21:24:30.000000000 +0900 +++ FileZilla_2_2_24b_src/source/FtpControlSocket.cpp 2006-06-09 22:53:16.000000000 +0900 @@ -31,6 +31,8 @@ #include "filezillaapi.h" #include "misc/utf8.h" +#include "StringTool.h" + #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE @@ -1070,6 +1072,7 @@ } else { + str = CStringTool::LOCALtoREMOTE(str); LPCSTR lpszAsciiSend = T2CA(str); int sendLen = strlen(lpszAsciiSend); diff -uNBb FileZilla_2_2_24b_src_orig/source/FtpListResult.cpp FileZilla_2_2_24b_src/source/FtpListResult.cpp --- FileZilla_2_2_24b_src_orig/source/FtpListResult.cpp 2006-06-08 20:14:44.000000000 +0900 +++ FileZilla_2_2_24b_src/source/FtpListResult.cpp 2006-06-09 22:53:16.000000000 +0900 @@ -26,6 +26,8 @@ #include "Options.h" #include "misc/utf8.h" +#include "StringTool.h" + #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; @@ -363,6 +365,21 @@ m_MonthNamesMap[_T("marras")] = 11; m_MonthNamesMap[_T("joulu")] = 12; + + //Japanese month names(EUC) + m_MonthNamesMap[_T("1\xb7\xee")] = 1; + m_MonthNamesMap[_T("2\xb7\xee")] = 2; + m_MonthNamesMap[_T("3\xb7\xee")] = 3; + m_MonthNamesMap[_T("4\xb7\xee")] = 4; + m_MonthNamesMap[_T("5\xb7\xee")] = 5; + m_MonthNamesMap[_T("6\xb7\xee")] = 6; + m_MonthNamesMap[_T("7\xb7\xee")] = 7; + m_MonthNamesMap[_T("8\xb7\xee")] = 8; + m_MonthNamesMap[_T("9\xb7\xee")] = 9; + m_MonthNamesMap[_T("10\xb7\xee")] = 10; + m_MonthNamesMap[_T("11\xb7\xee")] = 11; + m_MonthNamesMap[_T("12\xb7\xee")] = 12; + //There are more languages and thus month //names, but as long knowbody reports a //problem, I won't add them, there are way @@ -427,6 +444,7 @@ strcpy(tmpline, line); if (parseLine(tmpline, strlen(tmpline), direntry, tmp)) { + direntry.name = CStringTool::REMOTEtoLOCAL(direntry.name); delete [] tmpline; if (tmp) m_server.nServerType |= tmp; @@ -589,6 +607,7 @@ strcpy(tmpline, line); if (parseLine(tmpline, strlen(tmpline), direntry, tmp)) { + direntry.name = CStringTool::REMOTEtoLOCAL(direntry.name); delete [] tmpline; if (tmp) m_server.nServerType |= tmp; diff -uNBb FileZilla_2_2_24b_src_orig/source/SFtpIpc.cpp FileZilla_2_2_24b_src/source/SFtpIpc.cpp --- FileZilla_2_2_24b_src_orig/source/SFtpIpc.cpp 2004-10-27 23:23:23.000000000 +0900 +++ FileZilla_2_2_24b_src/source/SFtpIpc.cpp 2006-06-09 22:53:16.000000000 +0900 @@ -25,6 +25,8 @@ #include "sftpcontrolsocket.h" #include "SFtpCommandIDs.h" +#include "StringTool.h" + #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; @@ -416,9 +418,13 @@ BOOL CSFtpIpc::Send(const DWORD &nID, LPCTSTR str) { + USES_CONVERSION; - if (str) - return Send(nID, (const DWORD)strlen(T2CA(str))+1, (LPVOID)T2CA(str)); + if (str){ + CString strTmp(str); + strTmp = CStringTool::LOCALtoREMOTE(strTmp); + return Send(nID, (const DWORD)strlen(T2CA(strTmp))+1, (LPVOID)T2CA(strTmp)); + } else return Send(nID, 0, 0); } diff -uNBb FileZilla_2_2_24b_src_orig/source/ServerPath.cpp FileZilla_2_2_24b_src/source/ServerPath.cpp --- FileZilla_2_2_24b_src_orig/source/ServerPath.cpp 2005-10-25 23:04:27.000000000 +0900 +++ FileZilla_2_2_24b_src/source/ServerPath.cpp 2006-06-09 22:53:16.000000000 +0900 @@ -23,6 +23,7 @@ #include "stdafx.h" #include "ServerPath.h" #include "structures.h" +#include "StringTool.h" #ifdef _DEBUG #undef THIS_FILE @@ -79,6 +80,7 @@ CServerPath::CServerPath(CString path, int nServerType) { m_nServerType = nServerType; + path = CStringTool::REMOTEtoLOCAL(path); // not neccessary? path.TrimLeft( _T(" ") ); path.TrimRight( _T(" ") ); if (path == "") @@ -748,6 +750,7 @@ CServerPath::CServerPath(CString subdir, const CServerPath &parent) { *this=parent; + subdir = CStringTool::REMOTEtoLOCAL(subdir); // not neccessary? subdir.TrimLeft( _T(" ") ); subdir.TrimRight( _T(" ") ); @@ -1252,6 +1255,8 @@ BOOL CServerPath::SetPath(CString newpath) { + + newpath = CStringTool::REMOTEtoLOCAL(newpath); return SetPath(newpath, FALSE); } diff -uNBb FileZilla_2_2_24b_src_orig/source/SftpControlSocket.cpp FileZilla_2_2_24b_src/source/SftpControlSocket.cpp --- FileZilla_2_2_24b_src_orig/source/SftpControlSocket.cpp 2005-03-17 23:11:29.000000000 +0900 +++ FileZilla_2_2_24b_src/source/SftpControlSocket.cpp 2006-06-09 22:53:16.000000000 +0900 @@ -28,6 +28,7 @@ #include "SFtpCommandIDs.h" #include "FtpListResult.h" #include "FileExistsDlg.h" +#include "StringTool.h" #ifdef _DEBUG #undef THIS_FILE @@ -286,6 +287,8 @@ void CSFtpControlSocket::List(BOOL bFinish, int nError /*=0*/, CServerPath path /*=CServerPath()*/, CString subdir /*=""*/, int nListMode /*=0*/) { +//TRACE("List subdir: %s ... \n", (LPCTSTR)subdir); + LogMessage(__FILE__, __LINE__, this,FZ_LOG_DEBUG, _T("List(%s,%d,\"%s\",\"%s\",%d)"),bFinish?_T("TRUE"):_T("FALSE"),nError,path.GetPath(),subdir,nListMode); USES_CONVERSION; @@ -1338,6 +1341,7 @@ filename = pData->transferfile.remotefile; else filename = pData->transferfile.remotepath.GetPath() + pData->transferfile.remotefile; + filename = CStringTool::LOCALtoREMOTE(filename); int nLen1 = strlen(T2CA(filename)) + 1; int nLen2 = strlen(T2CA(pData->transferfile.localfile)) + 1; char *pCmd=new char[nLen1+nLen2+4]; @@ -1510,17 +1514,17 @@ char *pData; if (newPath.IsEmpty()) { - nLen = _tcslen( path.GetPath() + oldName + path.GetPath() + newName) + 2; + nLen = _tcslen( CStringTool::LOCALtoREMOTE(path.GetPath() + oldName + path.GetPath() + newName)) + 2; pData = new char[nLen]; - strcpy(pData, T2CA(path.GetPath() + oldName)); - strcpy(pData + _tcslen(path.GetPath() + oldName) + 1, T2CA(path.GetPath() + newName)); + strcpy(pData, T2CA(CStringTool::LOCALtoREMOTE(path.GetPath() + oldName))); + strcpy(pData + _tcslen(CStringTool::LOCALtoREMOTE(path.GetPath() + oldName)) + 1, T2CA(CStringTool::LOCALtoREMOTE(path.GetPath() + newName))); } else { - nLen = _tcslen( path.GetPath() + oldName + newPath.GetPath() + newName) + 2; + nLen = _tcslen(CStringTool::LOCALtoREMOTE( path.GetPath() + oldName + newPath.GetPath() + newName)) + 2; pData = new char[nLen]; - strcpy(pData, T2CA(path.GetPath() + oldName)); - strcpy(pData + _tcslen(path.GetPath() + oldName) + 1, T2CA(newPath.GetPath() + newName)); + strcpy(pData, T2CA(CStringTool::LOCALtoREMOTE(path.GetPath() + oldName))); + strcpy(pData + _tcslen(CStringTool::LOCALtoREMOTE(path.GetPath() + oldName)) + 1, T2CA(CStringTool::LOCALtoREMOTE(newPath.GetPath() + newName))); } if (!m_pDataChannel->Send(SFTP_DATAID_STC_RENAME, nLen, pData)) { @@ -1782,7 +1786,7 @@ pData->Current.AddSubdir(pData->Segments.front()); CString Segment=pData->Segments.front(); pData->Segments.pop_front(); - if (!m_pDataChannel->Send(SFTP_DATAID_STC_MKD,Segment)) + if (!m_pDataChannel->Send(SFTP_DATAID_STC_MKD, Segment)) { DoClose(); return; @@ -2923,7 +2927,7 @@ USES_CONVERSION; m_Operation.nOpMode=CSMODE_CHMOD; CString str; - str.Format( _T("%d %s%s"), nValue, path.GetPath(), filename); + str.Format( _T("%d %s%s"), nValue, CStringTool::LOCALtoREMOTE(path.GetPath()), CStringTool::LOCALtoREMOTE(filename)); int nLen = strlen(T2CA(str)) + 1; char *pData=new char[nLen]; strcpy(pData, T2CA(str)); diff -uNBb FileZilla_2_2_24b_src_orig/source/StringTool.cpp FileZilla_2_2_24b_src/source/StringTool.cpp --- FileZilla_2_2_24b_src_orig/source/StringTool.cpp 1970-01-01 09:00:00.000000000 +0900 +++ FileZilla_2_2_24b_src/source/StringTool.cpp 2006-06-09 22:53:16.000000000 +0900 @@ -0,0 +1,161 @@ +#include "stdafx.h" +#include "StringTool.h" + +#ifdef UNICODE +#include "iconv.h" +#else +#include +#endif +namespace CStringTool +{ +#ifndef UNICODE +static BOOL IsSJIS_Kanji(BYTE ch) +{ + return _ismbblead( (WORD)ch) != 0 ? TRUE:FALSE; +} + +static BOOL IsSJIS_Kana(BYTE ch) +{ + return _ismbbkana( (WORD)ch) != 0 ? TRUE:FALSE; +} +const CString LOCALtoREMOTE(const CString& str) +{ + CString strRet; + BYTE ch1; + BYTE ch2; + WORD wcode; + + for( int i = 0; i < str.GetLength(); i++) + { + ch1 = str[i]; + if( IsSJIS_Kanji( ch1) == TRUE) + { + i++; + ch2 = str[i]; + + wcode = MAKEWORD( ch2, ch1); + wcode = _mbcjmstojis( wcode); + + ch1 = HIBYTE( wcode) | 0x80; + ch2 = LOBYTE( wcode) | 0x80; + strRet += ch1; + strRet += ch2; + } + + else if( IsSJIS_Kana( ch1) == TRUE) + { + + strRet += (BYTE)0x8e; + strRet += ch1; + } + else + { + strRet += ch1; + } + } + return strRet; +} + +static BOOL IsJIS_Kana(BYTE ch) +{ + return ch == 0x8e ? TRUE:FALSE; +} + + +static BOOL IsJIS_Kanji(BYTE ch) +{ + return (ch >=0x21 && ch <=0x7e) ? TRUE:FALSE; +} + + +const CString REMOTEtoLOCAL(const CString& str) +{ + CString strRet; + BYTE ch1; + BYTE ch2; + WORD wcode; + + for( int i = 0; i < str.GetLength(); i++) + { + ch1 = str[i]; + + if( IsJIS_Kana( ch1) == TRUE) + { + i++; + ch2 = str[i]; + + strRet += ch2; + } + + else if( IsJIS_Kanji( ch1 ^ 0x80) == TRUE) + { + i++; + ch1 ^= 0x80; + ch2 = str[i] ^ 0x80; + wcode = MAKEWORD( ch2, ch1); + wcode = _mbcjistojms( wcode); + strRet += HIBYTE( wcode); + strRet += LOBYTE( wcode); + } + else + { + strRet += ch1; + } + } + return strRet; +} +#else +#define MAX_PATH_LEN 1024 +static const CString do_iconv(const CString& str, const char* tocode, const char* fromcode) +{ + + CString strRet; + iconv_t cd =iconv_open(tocode, fromcode); + if(cd==(iconv_t)-1){ + TRACE("error: iconv_open"); + return str; + } + + char inbuf[MAX_PATH_LEN+1]; + if(strlen(str) > MAX_PATH_LEN){ + return str; + } +// _tcscpy(inbuf, str); + strncpy(inbuf, str, MAX_PATH_LEN+1); + size_t inbytesleft = strlen(inbuf)+1; + char outbuf[MAX_PATH_LEN+1]; + size_t outbytesleft = MAX_PATH_LEN+1; + + const char* inbuf_p = (char*)&inbuf; + char* outbuf_p = (char*)&outbuf; + + size_t nconv = iconv(cd, &inbuf_p, &inbytesleft, + &outbuf_p, &outbytesleft); + + if(nconv == (size_t)-1){ + TRACE("errno: %d\n", errno); + TRACE("error: iconv\n"); + TRACE("%s\n", inbuf); + + return str; + } + + iconv_close(cd); + strRet = outbuf; + + return strRet; +} +#undef MAX_PATH_LEN + +const CString REMOTEtoLOCAL(const CString& str) +{ + return do_iconv(str, LOCAL_ENCODING, REMOTE_ENCODING); +} + +const CString LOCALtoREMOTE(const CString& str) +{ + return do_iconv(str, REMOTE_ENCODING, LOCAL_ENCODING); +} + +#endif +} diff -uNBb FileZilla_2_2_24b_src_orig/source/StringTool.h FileZilla_2_2_24b_src/source/StringTool.h --- FileZilla_2_2_24b_src_orig/source/StringTool.h 1970-01-01 09:00:00.000000000 +0900 +++ FileZilla_2_2_24b_src/source/StringTool.h 2006-06-09 22:53:16.000000000 +0900 @@ -0,0 +1,9 @@ + +namespace CStringTool{ + + const char * const REMOTE_ENCODING = "EUC-JP"; + const char * const LOCAL_ENCODING = "UTF-8"; + + const CString LOCALtoREMOTE(const CString& str); + const CString REMOTEtoLOCAL(const CString& str); +} \ No newline at end of file