]> source.dussan.org Git - redmine.git/commitdiff
Uploading of attachments which filename contains non-ASCII chars fails with Ruby...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 6 Apr 2012 09:31:29 +0000 (09:31 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 6 Apr 2012 09:31:29 +0000 (09:31 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9334 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/attachment.rb

index c9c33e3d41dbd73b15c8a4eea084dd5e219a056b..a6351da670cad81605a8e2fbd300420b73ef8c3a 100644 (file)
@@ -78,6 +78,7 @@ class Attachment < ActiveRecord::Base
       if @temp_file.size > 0
         if @temp_file.respond_to?(:original_filename)
           self.filename = @temp_file.original_filename
+          self.filename.force_encoding("UTF-8") if filename.respond_to?(:force_encoding)
         end
         if @temp_file.respond_to?(:content_type)
           self.content_type = @temp_file.content_type.to_s.chomp