vinyll / rails-mediabrowser

Rails 3 plugin providing a web interface to upload and manage images, videos, pdf's, folders and more.
MIT License
36 stars 5 forks source link

Encoding::UndefinedConversionError from ASCII-8BIT to UTF-8 #4

Closed pama closed 6 years ago

pama commented 13 years ago

In Ruby 1.9.2 we might have problems with UTF8.

One possible solution is to open files in binary format, for instance:

def create_file
  # code
  File.open(target, 'w+b') do |file|
  # more code