String parameter dll function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello.
I have troubles giving me a big headache, I hope somebody may help me.
I'm using Indy.Sockets to have FTP support for my VB.NET application (I also
tried with another dll made in C# but the trouble is the same).
The idea is that I added a dll as a reference to my project. There is a FTP
object which have the method put (path as string, name as string, append as
boolean).
Here is the trouble now and I saw a lot of articles on it but it didn't make
it clearer. When giving strings containing accentuated characters (eg. 'é')
to the string arguments, the accentuated characters are replaced by a '?'
causing the ftp upload to file (for example calling "ftp.put
("éééé","é",false) throws the ftp command "STOR ?".
What's the matter and how to solve it ? (maybe I have to convert my string
in an other type of sting but I can't figure out).
Best regards.
 
Hello Wyz,

é is a unicode character. Both the FTP library and the FTP server/OS must
understand unicode.
Unicode is a 2-byte character set.. so if either the Library and/or the server
only understand 1-byte character sets it'll interpret each byte of the 2-byte
character set as an individual character.. thus your problem.

Enjoy,
-Boo
 
Hello.
The FTP Server accepts them, I tested it.
What I don't understand is that how it can be loose from my vb to the dll
method and how to solve it...
Sincerly.
 
Ok.
We found it. The lot of FTP clients are getting a char buffer from which
they get the ascii chars.
My troubles are coming from here as "é" is not in ASCII encoding.
I finally found a C# DLL on which I can update the source code and I
replaced ASCII by the default encoding of the system.
Best regards.
 
Back
Top