Skip to content

Commit

Permalink
Fixes civicrm#2875 Accentuated characters incorrect in exported CSV f…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
nganivet authored and Sunil Pawar committed Feb 27, 2019
1 parent c3c4fd4 commit 2efb509
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CRM/Report/Utils/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ public static function makeCsv(&$form, &$rows) {
$config = CRM_Core_Config::singleton();
$csv = '';

// Add BOM for additional compatibility with Excel 2007 SP3 or more
// cf. http://stackoverflow.com/questions/155097/microsoft-excel-mangles-diacritics-in-csv-files
// and http://www.unicode.org/faq/utf_bom.html#bom1
$csv .= "\xEF\xBB\xBF";

// Add headers if this is the first row.
$columnHeaders = array_keys($form->_columnHeaders);

Expand Down

0 comments on commit 2efb509

Please sign in to comment.