Project

General

Profile

Actions

Feature #11301

closed

Add "byte order mark" to the export CSV file

Added by Alexey Korchuganov over 12 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
I18n
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

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

Is duplicate of Redmine - Feature #7037: CSV export encoding and excel. UTF-8 and BOMClosedJean-Philippe Lang2010-12-03

Actions
Actions

Also available in: Atom PDF