hi, Im sending data to the browser with a utf-8 charset but somehow when I open the file in excel, some garbage characters appear. Here''s my code: send_data(excel_file, :filename => "orders.xls", :type => ''application/vnd.ms-excel; charset=utf-8'' ) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Francis Sinson wrote:> hi, > > Im sending data to the browser with a utf-8 charset but somehow when I > open the file in excel, some garbage characters appear. > > Here''s my code: > > send_data(excel_file, :filename => "orders.xls", :type => > ''application/vnd.ms-excel; charset=utf-8'' )Replace: :type => ''application/vnd.ms-excel; charset=utf-8'' with: :type => ''application/vnd.ms-excel'' -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Deepak Vohra wrote:> Francis Sinson wrote: >> hi, >> >> Im sending data to the browser with a utf-8 charset but somehow when I >> open the file in excel, some garbage characters appear. >> >> Here''s my code: >> >> send_data(excel_file, :filename => "orders.xls", :type => >> ''application/vnd.ms-excel; charset=utf-8'' ) > > Replace: > :type => > ''application/vnd.ms-excel; charset=utf-8'' > > with: > :type => > ''application/vnd.ms-excel''the data is actually a csv file, and here is the one that im using: send_data(filename, :filename => "orders.csv", :type => ''application/vnd.ms-excel; charset=utf-8'' ) I just found out that Excel has an issue with csv files in unicode. What I did was use Iconv as a workaround and works as expected:) Thanks for the reply:) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---