]> source.dussan.org Git - nextcloud-server.git/commitdiff
make sure that contact data are always utf8 encoded to avoid encoding problems
authorBjoern Schiessle <schiessle@owncloud.com>
Mon, 11 Jun 2012 14:26:21 +0000 (16:26 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Mon, 11 Jun 2012 14:26:21 +0000 (16:26 +0200)
apps/contacts/import.php

index 0ee35f9fd81f094e54fa94950f98cba648e7deee..232de8233a9728b3c5b8567c3e884cf0749e7fd6 100644 (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