title: Ruby 1.9 + Net::FTP => Encoding::UndefinedConversionError
body: <p>i upgraded from Ruby 1.8.7 to 1.9.2 (and Rails 3.2.2) and have the problem that Net::FTP#gettextfile is throwing an Encoding::UndefinedConversionError</p>
  
  <p>I'm trying to download a xml file which is encoded as utf-8. The dowload works fine if i use getbinaryfile, but i would like to understand why gettextfile is not working.</p>
  
  <pre><code># -*- encoding : utf-8 -*-
  
  # working
  ftp = Net::FTP.open(host,user,password)
  ftp.passive = true
  ftp.getbinaryfile("some.xml","tmp/some.xml")
  
  # not working
  ftp = Net::FTP.open(host,user,password)
  ftp.passive = true
  # raises Encoding::UndefinedConversionError: "\xFF" from ASCII-8BIT to UTF-8
  ftp.gettextfile("some.xml","tmp/some.xml") 
  </code></pre>
  
  <p>I know that i can pass the external and internal encoding if use File.open like this:</p>
  
  <pre><code>File.open("some.xml", "r:ASCI-8BIT:UTF-8")
  </code></pre>
  
  <p>but couldn't find an option like this for Net::FTP.</p>
  
  <p>I also tried the block version of gettextfile, but this isn't working as well and gives the same error message.</p>
  
  <pre><code>File.open("some.xml", "w:ASCII-8BIT:UTF-8") do |file|
    ftp.gettextfile("some.xml") { |line| file.write line }
  end
  </code></pre>
  
  <p>Has anyone an idea what is wrong here?</p>