I'm trying to encode some nested lists of data in python in order to save the file as a csv and have others be able to access and use the data in Excel.
My data is supplied in UTF8
. As part of converting this into an Excel-friendly format, I typically decode from UTF8
and encode using cp1252
so that Excel can display the csv data correctly.
If the data is in Russian, I would use cp1251
instead, for the windows/excel-friendly Cyrillic character set.
However, I have issues with string which are a mixture of character sets.
If we take a string asdasdasd фоиииффииф
, is it possible to encode this in a manner that will allow me to save a csv that can be opened in Excel? It's not a problem in UTF8
of course, but I can't use that for opening in Excel...