CSV files cant store special characters?

6,895

This is a well known issue with saving CSV files in excel, and I do not believe it is possible to solve directly. However an addon such as this one (includes source) can be used to get around the issue.

How does it work?

As Excel can handle Unicode text (*.txt) files perfectly well, I’m relying on that to make this Addin work. On save, this Addin will be calling Excel’s SaveAs method to create a temporary Unicode Text file. It will then overwrite the original file by replacing all Tabs with comma and reload it. As it is a CSV file, Excel doesn’t preserve any column width adjustments or last active cell. Currently this Addin will reset the last active cell, and I think it should be pretty straightforward to reset column widths as well, if you wish to do so.

Share:
6,895

Related videos on Youtube

Kevlar
Author by

Kevlar

Updated on September 18, 2022

Comments

  • Kevlar
    Kevlar over 1 year

    I have read several other questions on this subject but none have an answer which fixes my problem.

    I have an execel file which is in russian and I need to convert it to CSV without it losing any of the special characters because at the moment it just converts them to "?"

    So far after reading similar questions I have tried:

    • saving to from .xlsx to .xls and then to .csv with no luck
    • importing the spreadsheet into google spreadsheets and downloading as .csv with no luck
    • downloading OpenOffice and trying to save it as CSV using Calc with no luck
    • Changing the encoding within excel when you saveit, going into web options. with no luck
    • opening it up in notpadd++ and encoding it as ANSI as well as other types with no luck.

    could someone help me out here is there anything else I can try?

    • karancan
      karancan almost 11 years
      I think what is important here is not just that it is a .csv file but the program that you are using to open it.Now, Microsoft Excel uses UTF-16 encoding while most other applications that open .csv files use UTF-8. I have had issues previously with UTF-8 encoded .csv. files not being treated properly in Excel (special characters) but other clients being able to handle them okay.