From 47712f77e9718652c516c85cde99a58d142f67c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 24 Oct 2011 10:18:15 +0200 Subject: [PATCH] Outputs iso-8859-1 in addresses list as excel cannot open utf-8 csv properly. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- include/userset.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/userset.inc.php b/include/userset.inc.php index 8dc2794..bcbe20e 100644 --- a/include/userset.inc.php +++ b/include/userset.inc.php @@ -425,7 +425,7 @@ class AddressesView implements PlView { $pids = $this->set->getIds(new PlLimit()); $visibility = Visibility::defaultForRead(Visibility::VIEW_AX); - pl_cached_content_headers('text/x-csv', 'utf-8', 1, 'adresses.csv'); + pl_cached_content_headers('text/x-csv', 'iso-8859-1', 1, 'adresses.csv'); $csv = fopen('php://output', 'w'); fputcsv($csv, array('adresses'), ';'); @@ -436,7 +436,7 @@ class AddressesView implements PlView WHERE pa.type = \'home\' AND pa.pub IN (\'public\', \'ax\') AND FIND_IN_SET(\'mail\', pa.flags) AND pa.pid IN {?} GROUP BY pa.pid', $pids); foreach ($res->fetchAllAssoc() as $item) { - fputcsv($csv, $item, ';'); + fputcsv($csv, array_map('utf8_decode', $item), ';'); } } fclose($csv); -- 2.1.4