# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1277633241 -32400
# Branch 0.9-patched
# Node ID 92c2890aa5cc9dd84ed31cc850ed154c7a8c6b32
# Parent  368d3473540b9684dd204091a18c631d216e0948
attachments: convert character encoding in the same manner as repositories

see also http://www.redmine.org/issues/2371

diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb
--- a/app/helpers/attachments_helper.rb
+++ b/app/helpers/attachments_helper.rb
@@ -29,6 +29,6 @@ module AttachmentsHelper
   end
   
   def to_utf8(str)
-    str
+    RepositoriesHelper.to_utf8 str
   end
 end
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb
--- a/app/helpers/repositories_helper.rb
+++ b/app/helpers/repositories_helper.rb
@@ -118,6 +118,7 @@ module RepositoriesHelper
     end
     str
   end
+  module_function :to_utf8
   
   def repository_field_tags(form, repository)    
     method = repository.class.name.demodulize.underscore + "_field_tags"
