csv_builder icon indicating copy to clipboard operation
csv_builder copied to clipboard

iconv conversion

Open ramigg opened this issue 13 years ago • 4 comments
trafficstars

Ruby 1.9.3 Rails 3.2.6 I need to produce output in UTF-16LE encoding.

It was not enough to supply @input_encoding = 'UTF-8' and @output_encoding = 'UTF-16LE' as it caused exception (from csv):

incompatible character encodings: UTF-16LE and US-ASCII

I had also supply :encoding => 'UTF-16LE' as part of @csv_options

ramigg avatar Jul 26 '12 08:07 ramigg

I'm sorry I haven't had a chance to look at this yet. If you can supply a patch I can review it and get it in sooner than later.

gtd avatar Aug 23 '12 15:08 gtd

I'm having a similar problem. I could do this by adding in a byte-order mark (bom) which I write as the first line in the CSV file. Can't get it to work in streaming mode. Any help would be appreciated.

https://gist.github.com/johnnyshields/5618928

johnnyshields avatar May 21 '13 10:05 johnnyshields

@gtd, please see my fork https://github.com/johnnyshields/csv_builder for a bom implementation + specs for non-streaming only (spec for streaming is commented-out). Can't figure out how to add a bom in streaming...

johnnyshields avatar May 21 '13 15:05 johnnyshields

@gtd this issue has been open for 7 years but it still affects us I believe. We're still using the fork mentioned above.

johnnyshields avatar May 24 '21 18:05 johnnyshields