summaryrefslogtreecommitdiffstats
path: root/lib/redmine/export/csv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/redmine/export/csv.rb')
-rw-r--r--lib/redmine/export/csv.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/redmine/export/csv.rb b/lib/redmine/export/csv.rb
index ce43240ba..3762eb661 100644
--- a/lib/redmine/export/csv.rb
+++ b/lib/redmine/export/csv.rb
@@ -35,7 +35,13 @@ module Redmine
col_sep = l(:general_csv_separator)
encoding = l(:general_csv_encoding)
- super(:col_sep => col_sep, :encoding => encoding, &block)
+ str = ''.force_encoding(encoding)
+ if encoding == 'UTF-8'
+ # BOM
+ str = "\xEF\xBB\xBF".force_encoding(encoding)
+ end
+
+ super(str, :col_sep => col_sep, :encoding => encoding, &block)
end
end