From: Bjoern Schiessle Date: Mon, 11 Jun 2012 14:26:21 +0000 (+0200) Subject: make sure that contact data are always utf8 encoded to avoid encoding problems X-Git-Tag: v4.5.0beta1~74^2~421^2~24 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=739589f4853fa1c7caab15150fa8d4a98fe94663;p=nextcloud-server.git make sure that contact data are always utf8 encoded to avoid encoding problems --- 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