id Version 10.
IdFTP1->IOHandler->DefStringEncoding = IndyTextEncoding(949);
수야!╋ 님이 쓰신 글 :
: 수얍니다.
:
: 별거 아닌거 같아도 어려운.. 어려운거 같아도 별거 아닌..
:
: 패치 런처 만들면서 했던 소스네요.
:
: 참고가 되시길..
:
: IdFTP1->Connect();
: IdFTP1->IOHandler->DefStringEncoding = TIdTextEncoding_UTF8;
:
: // 최초 이동할 폴더위치
: IdFTP1->ChangeDir( strPath );
:
: // 특히 두번째 인자는 전혀 신경쓰지 마세요.
: DownloadUpdateFile( ".\\", strPG_ID, strSaveFolder );
:
:
:
: void DownloadUpdateFile( IN AnsiString i_strFolder, IN AnsiString i_strPRG_ID, IN AnsiString i_strSaveFolder )
: {
: try
: {
: // 로컬에 해당 폴더 생성 - 뒤에 붙은 A는 Ansi꺼 쓰려는 것뿐입니다.
: ::CreateDirectoryA( i_strSaveFolder.c_str(), NULL );
:
: // 이동할 폴더위치
: IdFTP1->ChangeDir( i_strFolder );
:
: // 해당 폴더 아이템 가져오기
: IdFTP1->List();
:
: // 생성한 후 복사(Assign)하기 위함.. 폴더 이동하면 날라가버려서.. ㅋㅋ
: TIdFTPListItems *pIdFTPListItems = new TIdFTPListItems();
:
: try
: {
: pIdFTPListItems->Assign( IdFTP1->DirectoryListing );
:
: for( int i = 0; i < pIdFTPListItems->Count; i++ )
: {
: switch( pIdFTPListItems->Items[i]->ItemType )
: {
: case ditFile :
: {
: UnicodeString strFileName = pIdFTPListItems->Items[i]->FileName;
: UnicodeString strDownPath = AnsiString().sprintf( "%s\\%s",
: i_strSaveFolder.c_str(),
: AnsiString( strFileName ).c_str() );
: IdFTP1->Get( strFileName, strDownPath, true, false );
: }
: break;
: case ditDirectory :
: {
: DownloadUpdateFile( AnsiString().sprintf( "%s", AnsiString( pIdFTPListItems->Items[i]->FileName ).c_str() ),
: i_strPRG_ID,
: AnsiString().sprintf( "%s\\%s", i_strSaveFolder.c_str(), AnsiString( pIdFTPListItems->Items[i]->FileName ).c_str() ) );
: // 폴더에 들어갔으니 작업 다 했으면 나와야하기때문에..
: IdFTP1->ChangeDir( ".." );
: }
: break;
: }
: }
: }
: __finally
: {
: delete pIdFTPListItems;
: }
: }
: catch(...)
: {
: }
: }
: //---------------------------------------------------------------------------
:
: 코딩을 안하려고 해도.. 배운 도둑질은.. 쩝...
:
:
: 도와주세요. 님이 쓰신 글 :
: : XE5
: : FileZilla 서버를 사용중입니다.
: :
: : IdFTP1->Connect();
: : IdFTP1->IOHandler->DefStringEncoding = TIdTextEncoding_UTF8;
: : IdFTP1->SendCmd( "OPTS UTF8 ON" );
: :
: : IdFTP1->List();
: :
: : 이후
: : IdFTP1->ListResult 를 보면 한글들이 모조리 깨져있습니다.
: :
: : 어찌해야할까요?
: :
: : 도와주세요.