make sure that contact data are always utf8 encoded to avoid encoding problems

This commit is contained in:
Bjoern Schiessle 2012-06-11 16:26:21 +02:00
parent 4f6978c30f
commit 739589f485

View file

@ -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