FTP charset - Optional parameter or auto detection
Posted: Fri Jun 24, 2016 8:48 am
Good Morning 
I have a problem. I download any files with ReceiveFTPFile().
Some file names contain german umlauts (ä, ö, ü) or other special characters (ß) but FTPDirectoryEntryName() shows wrong file names.
My server uses the charset UTF-8 but PureBasic receives ASCII.
My example code:
I can't find the parameter to change of charset. The FTP client "FileZilla" has a charset function but PureBasic hasn't this.
I can convert the string to UTF-8 with UTF8() or with:
But this is a workaround. 
Can you add the charset parameter for OpenFTP() or a auto detection function?
Thank you

I have a problem. I download any files with ReceiveFTPFile().
Some file names contain german umlauts (ä, ö, ü) or other special characters (ß) but FTPDirectoryEntryName() shows wrong file names.
My server uses the charset UTF-8 but PureBasic receives ASCII.
My example code:
Code: Select all
EnableExplicit
InitNetwork()
If OpenFTP(1, "rsbasic.de", "webika3rg_qch3ai", "PureBasic!2016")
If ExamineFTPDirectory(1)
While NextFTPDirectoryEntry(1)
Debug FTPDirectoryEntryName(1)
Wend
EndIf
CloseFTP(1)
EndIf
I can convert the string to UTF-8 with UTF8() or with:
Code: Select all
Procedure.s AsciiToUTF8(String$)
Protected Buffer$
Buffer$ = Space(Len(String$))
PokeS(@Buffer$, String$, -1, #PB_Ascii)
String$ = PeekS(@Buffer$, -1, #PB_UTF8)
ProcedureReturn String$
EndProcedure

Can you add the charset parameter for OpenFTP() or a auto detection function?
Thank you
