send charset information in response for wp csv

pull/888/head
Markus Kahl 11 years ago
parent 569dc6a361
commit 88b5d4f94a
  1. 3
      app/controllers/work_packages_controller.rb
  2. 2
      spec/controllers/work_packages_controller_spec.rb

@ -232,8 +232,9 @@ class WorkPackagesController < ApplicationController
end
format.csv do
serialized_work_packages = WorkPackage::Exporter.csv(work_packages, @project)
charset = "charset=#{l(:general_csv_encoding).downcase}"
send_data(serialized_work_packages, :type => 'text/csv; charset=utf-8; header=present',
send_data(serialized_work_packages, :type => "text/csv; #{charset}; header=present",
:filename => 'export.csv')
end
format.pdf do

@ -188,7 +188,7 @@ describe WorkPackagesController do
.and_return(mock_csv)
controller.should_receive(:send_data).with(mock_csv,
:type => 'text/csv; header=present',
:type => 'text/csv; charset=utf-8; header=present',
:filename => 'export.csv') do |*args|
# We need to render something because otherwise
# the controller will and he will not find a suitable template

Loading…
Cancel
Save