“\ xFF”从迷你魔法中的ASCII-8BIT到UTF-8

时间:2015-01-10 09:27:36

标签: ruby-on-rails ruby minimagick

我在模特中做这些

def self.get_store_resize_image(filename, store_id)

    filename=filename.gsub(' ', '%20')

    image = MiniMagick::Image.open(filename) #getting error here
    image.resize "252x185"  ## The thumbnail size

    temp_file_name="#{Time.now.to_time.to_i}_#{store_id}"
    @store_image_path="#{Rails.root}/public/tmp/#{temp_file_name}.png"
    @store_image="/tmp/#{temp_file_name}.png"
    image.write(@store_image_path)
    return @store_image
end

如何将“\ xFF”从ASCII-8BIT修复为UTF-8错误?

0 个答案:

没有答案