0

Hello im using the gem net-sftp to upload a list of files, the upload proceess works as expected but when I upload a file that has a forwardtick on the name the forwardtick is changed on the remote server by a '?'

Code

    local_file = 'C:/Users/UserA/Documents/RubyProjects/test/The Posesión.pdf'
    remote_file = '/home/UserA/test/The Posesión.pdf'
    sftp.upload!(local_file, remote_file)do |event, uploader, *args|
      case event
      when :open then
        puts "          Upload file: #{args[0].remote}"
      when :put then
        #puts "          Writing #{args[2].length} bytes to #{args[0].remote} starting at #{args[1]}"
      when :close then
        # args[0] : file metadata
        puts "          Upload finished with #{args[0].remote}"
      when :mkdir then
        # args[0] : remote path name
        puts "          Creating dir #{args[0]}"
      when :finish then
        upcount = upcount + 1
      end
    end

Example

Local file name: The Posesión.pdf

Remote Result: The Posesi?n.pdf

Does anybody knows a way to avoid this behavior?

Update

I tested the same code but in a different sftp server (windows) and I got an error maybe this is a bug?

incompatible character encodings: ASCII-8BIT and UTF-8

Rodrigo Montano
  • 303
  • 5
  • 13

0 Answers0