From cda9df71016cd7a85d93fbe5b38da6f532c938de Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 12 Jul 2010 08:56:30 -0400 Subject: [PATCH] bug [export] CSV for MS Excel (Windows) should have semi-colon as separator --- ChangeLog | 1 + libraries/export/csv.php | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index de56291a4..ab9802ebe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #3027557 [PHP] split() deprecated in PHP 5.3 (backport fixes from master, todo: update PHP excel?) - bug #3023507 [core] No result set display from stored procedure SELECT +- bug [export] CSV for MS Excel (Windows) should have semi-colon as separator 3.3.4.0 (2010-06-28) - bug #2996161 [import] properly escape import value diff --git a/libraries/export/csv.php b/libraries/export/csv.php index 9a8e52007..ebcf0cd03 100644 --- a/libraries/export/csv.php +++ b/libraries/export/csv.php @@ -70,7 +70,18 @@ function PMA_exportHeader() { // Here we just prepare some values for export if ($what == 'excel') { $csv_terminated = "\015\012"; - $csv_separator = isset($GLOBALS['excel_edition']) && $GLOBALS['excel_edition'] == 'mac_excel2003' ? ';' : ','; + switch($GLOBALS['excel_edition']) { + case 'win': + // as tested on Windows with Excel 2002 and Excel 2007 + $csv_separator = ';'; + break; + case 'max_excel2003': + $csv_separator = ';'; + break; + case 'max_excel2008': + $csv_separator = ','; + break; + } $csv_enclosed = '"'; $csv_escaped = '"'; if (isset($GLOBALS['excel_columns'])) {