mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-18 07:52:21 +01:00
make sure that contact data are always utf8 encoded to avoid encoding problems
This commit is contained in:
parent
0101088e95
commit
cd06ab6e6e
@ -63,13 +63,13 @@ foreach($lines as $line){
|
|||||||
if(strtoupper(trim($line)) == 'BEGIN:VCARD'){
|
if(strtoupper(trim($line)) == 'BEGIN:VCARD'){
|
||||||
$inelement = true;
|
$inelement = true;
|
||||||
} elseif (strtoupper(trim($line)) == 'END:VCARD') {
|
} 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);
|
$parts[] = implode($nl, $card);
|
||||||
$card = array();
|
$card = array();
|
||||||
$inelement = false;
|
$inelement = false;
|
||||||
}
|
}
|
||||||
if ($inelement === true && trim($line) != '') {
|
if ($inelement === true && trim($line) != '') {
|
||||||
$card[] = $line;
|
$card[] = iconv(mb_detect_encoding($line, 'UTF-8, ISO-8859-1'), 'utf-8', $line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//import the contacts
|
//import the contacts
|
||||||
|
Loading…
x
Reference in New Issue
Block a user