Arabic text showing not properly in the file of s3

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

https://lh3.googleusercontent.com/-7MUHzpfGKls/VdWzcCb2WkI/AAAAAAAAAY8/k_hYB0rIqrw/s1600/Screen%2BShot%2B2015-08-20%2Bat%2B2.16.55%2BPM.png

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_s

On Thursday, 20 August 2015 06:03:13 UTC-5, amtest wrote:

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_s

You 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 J.

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 J.

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”

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs