From 739589f4853fa1c7caab15150fa8d4a98fe94663 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 11 Jun 2012 16:26:21 +0200 Subject: [PATCH] make sure that contact data are always utf8 encoded to avoid encoding problems --- apps/contacts/import.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/contacts/import.php b/apps/contacts/import.php index 0ee35f9fd81..232de8233a9 100644 --- a/apps/contacts/import.php +++ b/apps/contacts/import.php @@ -63,13 +63,13 @@ foreach($lines as $line){ if(strtoupper(trim($line)) == 'BEGIN:VCARD'){ $inelement = true; } elseif (strtoupper(trim($line)) == 'END:VCARD') { - $card[] = $line; + $card[] = iconv(mb_detect_encoding($line, 'UTF-8, ISO-8859-1'), 'utf-8', $line); $parts[] = implode($nl, $card); $card = array(); $inelement = false; } if ($inelement === true && trim($line) != '') { - $card[] = $line; + $card[] = iconv(mb_detect_encoding($line, 'UTF-8, ISO-8859-1'), 'utf-8', $line); } } //import the contacts -- 2.39.5