summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-06-23 16:55:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-06-23 16:55:17 +0000
commit600018d5adfd627f8a72d39c19f770e64b40ba72 (patch)
tree51fc27762ea55e39101b6b6cb5e46820c6b9029c /app
parentec44c94c12ca7c2dc143c396b6e605297e8ad4bf (diff)
downloadredmine-600018d5adfd627f8a72d39c19f770e64b40ba72.tar.gz
redmine-600018d5adfd627f8a72d39c19f770e64b40ba72.zip
Fixed Iconv::IllegalSequence errors in csv exports
git-svn-id: http://redmine.rubyforge.org/svn/trunk@570 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb4
-rw-r--r--app/controllers/timelog_controller.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 0f9b0f52c..8f7969feb 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -325,7 +325,7 @@ class ProjectsController < ApplicationController
for custom_field in @project.all_custom_fields
headers << custom_field.name
end
- csv << headers.collect {|c| ic.iconv(c) }
+ csv << headers.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
# csv lines
@issues.each do |issue|
fields = [issue.id, issue.status.name,
@@ -344,7 +344,7 @@ class ProjectsController < ApplicationController
for custom_field in @project.all_custom_fields
fields << (show_value issue.custom_value_for(custom_field))
end
- csv << fields.collect {|c| ic.iconv(c.to_s) }
+ csv << fields.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
end
end
export.rewind
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index c07a76060..da323fbf1 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -61,7 +61,7 @@ private
l(:field_hours),
l(:field_comments)
]
- csv << headers.collect {|c| ic.iconv(c) }
+ csv << headers.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
# csv lines
@entries.each do |entry|
fields = [l_date(entry.spent_on),
@@ -71,7 +71,7 @@ private
entry.hours,
entry.comments
]
- csv << fields.collect {|c| ic.iconv(c.to_s) }
+ csv << fields.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
end
end
export.rewind