Feature #11301
closedAdd "byte order mark" to the export CSV file
0%
Description
I would like to suggest adding a possibility of inserting "byte order mark" to the export CSV file. These bytes make life of windows users slightly easier, because the most of Windows* programs do not use UTF-8 as default charset for text files, so they cannot parse UTF-8 file correctly if use non english text. And users have to choose encoding manyally.
I would not like to suggest hard coding, because there are some limitations, several are described here: http://en.wikipedia.org/wiki/UTF-8#Byte_order_mark
I think, the right way is: to add an option which will control of inserting these bytes
following example of hard coding for my istallation
based on changeset: 9852:4e40d59645ea
tag: tip
user: jplang
date: Wed Jun 20 19:24:58 2012 +0000
diff:
--- a/app/helpers/issues_helper.rb Tue Jun 19 02:11:16 2012 0000
++ b/app/helpers/issues_helper.rb Mon Jul 02 12:53:55 2012 +0400@ -322,7 +322,7
@
export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
# csv header fields
- csv << [ "#" ] + columns.collect {|c| Redmine::CodesetUtil.from_utf8(c.caption.to_s, encoding) }
csv << [[ 0xEF, 0xBB, 0xBF, 35 ].pack("c*") ] + columns.collect {|c| Redmine::CodesetUtil.from_utf8(c.caption.to_s, encoding) } +
(options[:description] ? [Redmine::CodesetUtil.from_utf8(l(:field_description), encoding)] : [])
Thank you
Alexey
Related issues