Page 1 of 1

FTPDirectoryEntryName CP1251

Posted: Mon Jul 27, 2015 10:27 am
by Gemorg
Hi!
I am using this code:

Code: Select all

InitNetwork()

If OpenFTP(0, "XXX.XXX.XX.XXX", "XXXXX", "XXXXXXX", 0)
  
  If ExamineFTPDirectory(0)
    While NextFTPDirectoryEntry(0)
      Debug FTPDirectoryEntryName(0)
    Wend
  EndIf
  
  Debug "finished"
  
Else
  MessageRequester("Error", "Can't connect to the FTP server")
EndIf
FTP server has a folder with Russian characters: "Сервер Готы".
But in the debug output is: "Сервер Готы"

I tried to compile in Ansi and Unicode mode, there is no difference.

Re: FTPDirectoryEntryName CP1251

Posted: Mon Jul 27, 2015 3:13 pm
by IdeasVacuum
It might be a function limitation, but make sure the following is true:

Use latest version PB5.31 which delivers a UTF8 debug window.
Use a font for the PB IDE that supports the Unicode required for the Russian language (Microsoft Sans Serif, Source Code Pro).
Ensure that your source code files are UTF8 (sounds strange but it is currently necessary).
Compile in Unicode mode.