New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excel compability #3

Open
petRUShka opened this Issue Jul 18, 2010 · 0 comments

Comments

Projects
None yet
1 participant
@petRUShka

petRUShka commented Jul 18, 2010

Excel needed csv file to be converted to utf-16le and byte_order_marker at the start of file.
I needed to write such code for escel compability:


         csv = ar_array.to_csv
         csv = "\xEF\xBB\xBF" + csv if ar_array.blank?
         csv = Iconv.conv("utf-16le", "utf-8", csv)

First, I need do convert from utf-8 to utf-16le (otherwise excel can't recognize encoding of file). And second I need to add byte_order_marker if array is blank, because excel get an error if I tried to open such file.

It would be great if exists the option of to_csv, that set excel compability!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment