foreign language support - WeOnlyDo Discussion board

foreign language support (wodFtpDLX / wodFtpDLX.NET)

by tallycom, Friday, May 15, 2015, 06:58 (1585 days ago)

I am using visual c++ with wodftpdlx
server : wodFTPD

its working fine at ftp protocol mode

[code]
....
m_ftpData.SetPort(21);
m_ftpData.SetProtocol(0);
....
VARIANT vLocalFile;
VARIANT vRemoteFile;
vLocalFile.vt = VT_BSTR;
vRemoteFile.vt = VT_BSTR;
CString str1 = "d:\\desktop\\테스트.txt";
CString str2 = "/테스트.txt";
vLocalFile.bstrVal = str1.AllocSysString();
vRemoteFile.bstrVal = str2.AllocSysString();
m_ftpData.GetFile(vLocalFile, vRemoteFile);


but component returned an error message at sftp protocol mode

"sever returned an error:"

[code]
....
m_ftpData.SetPort(22);
m_ftpData.SetProtocol(1);
....
VARIANT vLocalFile;
VARIANT vRemoteFile;
vLocalFile.vt = VT_BSTR;
vRemoteFile.vt = VT_BSTR;
CString str1 = "d:\\desktop\\테스트.txt"; //included foreign language string (korean)
CString str2 = "/테스트.txt"; //included foreign language string (korean)
vLocalFile.bstrVal = str1.AllocSysString();
vRemoteFile.bstrVal = str2.AllocSysString();
m_ftpData.GetFile(vLocalFile, vRemoteFile);

please help

foreign language support

by Jasmine, Friday, May 15, 2015, 08:53 (1585 days ago) @ tallycom

Hi Yoon.

I believe this line:

vLocalFile.bstrVal = str1.AllocSysString();

uses CP_ANSI conversion from (char *) to (BSTR). I suggest you switch to using UTF8 conversion. So, instead of using CString's integrated AllocSysString, you can convert string to BSTR by yourself using

int nLen = WideCharToMultiByte(CP_UTF8, 0, unicodestr, -1, ansistr, a, NULL...)

and then pass that BSTR to vLocalFile.bstrVal.

Can you try that?

Regards,
Jasmine.