Ruby on Rails
Monday, August 24, 2015
On Friday, 21 August 2015 08:24:46 UTC-4, amtest wrote:
Thanks matt, can you suggest me to do any work around for this, i have been sitting with these issue for some days? the default encoding in my application is config.encoding = "utf-8"
My suggestion would be to go through all the code that's handling this data and verify that the values are correctly-encoded. For instance:
* is the data coming into the system from the user correctly encoded?
* is the database column the data is stored in correctly encoded?
* is the code that writes the CSV setting the correct encoding?
Corrupted data earlier in the process will generally be passed straight through subsequent steps, so troubleshooting starting from the end (the CSV file on S3) is going to be difficult.
--Matt Jones
On Friday, 21 August 2015 15:55:00 UTC+4, Matt Jones wrote:
On Thursday, 20 August 2015 06:03:13 UTC-5, amtest wrote:I have uploaded the csv to s3 with rails, but the issue is, that the file have arabic names, so when i open that csv file directly from s3 console, its showing the arabic names as gibberish, i have attached that image here
also i tried to add that "charset utf", but its showing as same, is there any workaround for this?
url = object.url_for(:read, {expires: E::EXPIRE, :content_type => "text/csv;charset=utf-8", response_content_disposition: "attachment;filename=#{
filename[0]}.csv" }).to_sYou may need to verify the data is not already corrupted in the CSV. The text you've pasted looks like the result of double-encoding the names in UTF8. For instance, the first two characters:اare codepoints U+D8 and U+A7. Together, those two bytes (read as UTF8) make up the single character U+0627 (ARABIC LETTER ALEF) which is what I suspect is the intended value.--Matt Jones
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/eb0e044e-f9ca-47da-858b-fddc72e9b125%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment