Jump to content
Sign in to follow this  
Synchro

_FTP_FilePut and Unicode file names

Recommended Posts

Synchro

I'm having trouble using Chinese Unicode file names with _FTP_FilePut().

I can read the file names correctly with FileFindNextFile(), but they are munged on the remote machine when sent via _FTP_FilePut().

I tried converting the file names to UTF-8 using _WinAPI_WideCharToMultiByte(), but that didn't help either.

I can transfer the file names correctly using FileZilla if I force it to use UTF-8.

Has anyone had any success using Unicode file names with _FTP_FilePut()?

Share this post


Link to post
Share on other sites
Synchro

I tried modifying _FTP_FilePut() to send a UTF-8 string via FtpPutFileA() and to send wide strings via FtpPutFileEx(), to no avail.

I'm beginning to suspect that DllCall() doesn't pass wide strings correctly.

Has anyone successfully passed wide strings to DllCall()?

Edited by Synchro

Share this post


Link to post
Share on other sites
ProgAndy

DLLCall has no bug with wstr. The problem should be FTPPutFile. I think, it converts the unicode to ascii before sending the string to the server. You should try to use FtpOpenFileA with an UTF-8 encoded string and InternetWriteFile. You could modify the _FTP_ProgressUpload for that.


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
Synchro

It looks like updating to v3.3.6.1 fixed the problem.

I can now send Chinese file names via _FTP_FilePut() if I convert them to UTF-8 using _WinAPI_WideCharToMultiByte().

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.