title: Pandas: save to excel encoding issue
body: <p>I have a similar problem to the one mentioned <a href="https://stackoverflow.com/questions/22681615/cant-export-pandas-dataframe-to-excel-encoding">here</a> but none of the suggested methods work for me.</p>
  
  <p>I have a medium size <code>utf-8</code> .csv file with a lot of non-ascii characters.
  I am splitting the file by a particular value from one of the columns, and then I'd like to save each of the obtained dataframes as an .xlsx file with the characters preserved.</p>
  
  <p>This doesn't work, as I am getting an error:</p>
  
  <pre><code>UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 7: ordinal not in range(128)
  </code></pre>
  
  <p>Here is what I tried:</p>
  
  <ol>
  <li>Using <code>xlsxwriter</code> engine explicitly. This doesn't seem to change anything.</li>
  <li><p>Defining a function (below) to change encoding and throw away bad characters. This also doesn't change anything.</p>
  
  <pre><code>def changeencode(data):
  cols = data.columns
  for col in cols:
  if data[col].dtype == 'O':
      data[col] = data[col].str.decode('utf-8').str.encode('ascii', 'ignore')
  return data   
  </code></pre></li>
  <li><p>Changing by hand all the offensive chars to some others. Still no effect (the quoted error was obtained after this change). </p></li>
  <li><p>Encoding the file as <code>utf-16</code> (which, I believe, is the correct encoding since I want to be able to manipulate the file from within the excel afterwards) doesn't help either.</p></li>
  </ol>
  
  <p>I believe that the problem is in the file itself (because of 2 and 3) but I have no idea how to get around it. I'd appreciate any help. The beginning of the file is pasted below.</p>
  
  <pre><code>"Submitted","your-name","youremail","phone","miasto","cityCF","innemiasto","languagesCF","morelanguages","wiek","partnerCF","messageCF","acceptance-795","Submitted Login","Submitted From","2015-12-25 14:07:58 +00:00","Zózia kryś","test@tes.pl","4444444","Wrocław","","testujemy polskie znaki","Polski","testujemy polskie znaki","44","test","test","1","Justyna","99.111.155.132",
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Some code (one of the versions, without the splitting part):</p>
  
  <pre><code>import pandas as pd
  import string
  import xlsxwriter
  
  df = pd.read_csv('path-to-file.csv')
  
  with pd.ExcelWriter ('test.xlsx') as writer:
                  df.to_excel(writer, sheet_name = 'sheet1',engine='xlsxwriter')
  </code></pre>