2

In Reports, special characters are displayed correctly.

But when I export a Report to a CSV file, special characters are not displayed

Ex.: Hélène (in the report) becomes Hélène in the CSV file.

Is there any solution ?

(Currently in 4.7.12)

1
  • What application is the one you're using to view the CSV? Unclear from your question, but might be this application is identifying an incorrect character set when displaying the data. Some apps will prompt you to choose character set / encoding on opening a document which it is unable to identify. I've also seen exported CSV contain more than one encoding (where the DB contained rows in various encodings, entered from different OS). Feb 25, 2017 at 10:21

2 Answers 2

3

As @Chris Burgess said it depends on the software you're using the CSV with, but i'll leave a preemptive workaround for MS Excel since we do this pretty often.

This happens with Excel because CiviCRM exports the data in UTF-8 encoding and Excel tries to open it using ANSI by default. If you download your CSV, open and new workbook, and import your data into it as follows, the characters will display correctly:

  • Save the exported file as a csv
  • Open Excel
  • Import the data using Data-->Import External Data--> Import Data (may vary slightly depending on your version of excel, can be Data-->Get External Data-->From Text button)

  • Select the file type of "csv" and browse to your file

  • In the import wizard change the File_Origin to "65001 UTF"
  • Change the Delimiter to comma Select where to import to and Finish

A bit of an annoying workaround but I hope this is helpful!

1

I have struggled with the same problem, but Excel on a Mac does not offer precisely that option (65001 UTF) for import. It does offer a UTF-8 import option but that does not work--it just changes the non-ASCII characters to other characters but not the correct ones. I have not found an import option on the Mac that takes in the CiviCRM csv files correctly.

My solution was to get a copy of LibreOffice and that takes in the CiviCRM-produced csv files without a hitch. From LO I can save an xls file that Excel does read correctly.

2
  • Thanks, good to know that LO works well, since that solution is available to everyone (or most people)! With regards to Excel on Mac - it depends on version... I know this has been a big issue in the past, but the import method above with UTF-8 will work in Excel for Mac 2016 (and hopefully versions moving forward). I don't believe they backported this fix to older versions unfortunately.. Feb 27, 2017 at 21:56
  • Ah, so it is fixed in 2016 version. I'm still on 2011. Might be a reason for upgrading if using LO wasn't so easy. Thanks for that. Feb 28, 2017 at 23:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.