String parameter dll function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wyz

    #1

    String parameter dll function

    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.

  • GhostInAK

    #2
    Re: String parameter dll function

    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
    [color=blue]
    > 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
    > ("éééé","é",fal se) 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.[/color]


    Comment

    • Wyz

      #3
      Re: String parameter dll function

      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.

      "GhostInAK" wrote:
      [color=blue]
      > 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
      >[color=green]
      > > 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.[/color]
      >
      >
      >[/color]

      Comment

      • Wyz

        #4
        Re: String parameter dll function

        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.

        Comment

        Working...