title: export to excel french character
body: <p>I have the following method on on my action to export to excel a list of user:</p>
  
  <pre><code>def users_report
      @users = Kid.where(confirmation_token: nil).paginate(:page =&gt; params[:page], :per_page =&gt; 30)
      @userxls = Kid.where(confirmation_token: nil)
      respond_to do |format|
          format.html
          format.xls { send_data @userxls.to_csv({col_sep: "\t"}) }
      end
  end
  </code></pre>
  
  <p>On my model the to_csv method:</p>
  
  <pre><code>def self.to_csv(options = {})
      CSV.generate(options) do |csv|
      csv &lt;&lt; ["Name", "Surname", "E-mail", "Age", "School", "Class", "Native Language", "Practised Language", "Conversations same Native", "Convserations different Native", "Message same Native", "Message different Native", "Posts", "Clossed/Finished calls", "Missed calls", "Connections per Week", "Nb of foreign friends", "Nb of friends same country", "Activation Date", "Email Parent", "Parent Activated"]
          kids = Array.new
          all.each do |kid|
              if kid.user_role != "admin"
                  k   = Array.new
                  kid.name = kid.name rescue "No name"
                  k &lt;&lt; kid.name
                  kid.surname = kid.surname rescue "No surname"
                  k &lt;&lt; kid.surname
                  kid.email = kid.email rescue "No email"
                  k &lt;&lt; kid.email
                  k &lt;&lt; kid.age rescue "No age"
                  if !kid.school.nil?
                      k &lt;&lt; kid.school.name
                  else
                      k &lt;&lt; "No School"
                  end
                  if kid.courses.empty?
                      k &lt;&lt; "No Courses"
                  else
                      k &lt;&lt; kid.courses.first.name
                  end
  
                  if !kid.native_languages.empty?
                      languages = Array.new
                      kid.native_languages.each do |lang|
                          languages &lt;&lt; Language.find(lang).name
                      end
                      k &lt;&lt; languages
                  else
                      k &lt;&lt; "No native language"
                  end
                  if !kid.practice_languages.empty?
                      languages = Array.new
                      kid.practice_languages.each do |lang|
                          languages &lt;&lt; Language.find(lang).name
                      end
                      k &lt;&lt; languages
                  else
                      k &lt;&lt; "No practise language"
                  end
  
                  k &lt;&lt; kid.number_of_native_conversations rescue "0"
                  k &lt;&lt; kid.number_of_foreign_conversations rescue "0"
                  k &lt;&lt; kid.number_of_native_messages rescue "0"
                  k &lt;&lt; kid.number_of_foreign_messages rescue "0"
                  k &lt;&lt; kid.number_of_activity_posts rescue "0"
                  k &lt;&lt; kid.number_of_finished_closed_calls rescue "0"
                  k &lt;&lt; kid.number_of_missed_calls rescue "0"
                  k &lt;&lt; kid.avg_of_connections_week rescue "0"
                  k &lt;&lt; kid.number_of_foreign_friends rescue "0"
                  k &lt;&lt; kid.number_of_friends_same_country rescue "0"
                  k &lt;&lt; kid.confirmed_at.try(:strftime, "%d/%m/%Y") rescue "0"
                  k &lt;&lt; kid.tutor.email rescue "No parent email"
                  k &lt;&lt; kid.tutor.confirmed? rescue "No parent email"
  
                  kids &lt;&lt; k
              end
          end
          kids.each do |k|
              csv &lt;&lt; k
          end
    end
  end
  </code></pre>
  
  <p>But on my excel file I'm getting names like JÃ©rÃ´me instead of Jérôme. I tried:</p>
  
  <pre><code># encoding: utf-8
  </code></pre>
  
  <p>on my view also tried for every field</p>
  
  <pre><code>.force_encoding("UTF-8") 
  </code></pre>
  
  <p>But I still have this problem. Please I really need help with this.</p>
  
  <p>Thanks in advance</p>