diff --git a/CRM/Report/Utils/Report.php b/CRM/Report/Utils/Report.php index 9bd425d70902..629eafad8123 100644 --- a/CRM/Report/Utils/Report.php +++ b/CRM/Report/Utils/Report.php @@ -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);