From: Kad Kerforn Date: 2011-01-13T17:42:44+09:00 Subject: Ruby 1.9.2 encoding issue [Rails 3 - Ruby 1.9.2] I have to get email attachments ( mp4 files ) and store them... I get easily all parts using Mail ( .... ) attachment = mail.attachments[0] #, , > got what I need, but trying to store this attachment in a temp file , I get an encoding error : File.open(filepath,File::CREAT|File::TRUNC|File::WRONLY,0644) { | f| f.write(attachment.body) } Encoding::UndefinedConversionError Exception: "\x80" from ASCII-8BIT to UTF-8 did I miss anything before writing the file ? or is it a known Ruby bug ? being an .mp4 attachment, it should be a binary file.. it comes as an UTF-8 ( Base64) ? , right... how should I write it as a binary too ? tfyh -- Posted via http://www.ruby-forum.com/.