Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FTP Upload - Special characters
#1
Hi !

I have a problem when uploading files to an FTP server that contains "special characters"

For example, if i want to upload a file named "Voici le Maître.jpeg" , it uploads correctly, but when i look in the FTP directory, the file is renamed : "Voici le Ma" , with no file extensions.

Macro testupload
Code:
Select All      Help
Ftp f
f.Connect("ftp.server.test" "user" "pwd" 21 0 1)
f.DirSet(F"temp")
f.SetProgressDialog(1 "Progress")
f.FilePut(F"$desktop$\Voici le Maître.jpeg" F"Voici le Maître.jpeg")

Note : If i upload directly from Filezilla, there is no problems

Can you help me ? Thanks Smile
#2
Update :

Found out the solution by myself :-)
I roamed in the forum and found out what i needed Smile

Just in case :

Macro testupload
Code:
Select All      Help
Ftp f
f.Connect("ftp.server.test" "user" "pwd" 21 0 1)
f.DirSet(F"temp")
f.SetProgressDialog(1 "Progress")

str filename="Voici le Maître.jpeg"
filename.ConvertEncoding(CP_ACP CP_UTF8)

f.FilePut(F"$desktop$\Voici le Maître.jpeg" F"{filename}")
#3
But this code will stop working if one day you'll check "Unicode" in Options.

replace
filename.ConvertEncoding(CP_ACP CP_UTF8)
with
if(!_unicode) filename.ConvertEncoding(CP_ACP CP_UTF8)
or
filename.ConvertEncoding(_unicode CP_UTF8)


Forum Jump:


Users browsing this thread: 1 Guest(s)