Skip to content
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

iconv conversion #12

Open
ramigg opened this issue Jul 26, 2012 · 4 comments
Open

iconv conversion #12

ramigg opened this issue Jul 26, 2012 · 4 comments

Comments

@ramigg
Copy link

ramigg commented Jul 26, 2012

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

@gtd
Copy link
Owner

gtd commented Aug 23, 2012

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.

@johnnyshields
Copy link

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
Copy link

@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
Copy link

johnnyshields commented May 24, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants