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 committed Jul 29, 2017
1 parent 9105c81 commit bc0d57e
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 bc0d57e

Please sign in to comment.