1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-11-30 12:24:11 +01:00

Use mb_convert_encoding() if iconv() is not available.

This commit is contained in:
Thomas Tanghus 2012-10-25 23:09:39 +02:00
parent d5d81b36c7
commit 3b3adb318a

View File

@ -224,6 +224,8 @@ class VCard {
} }
if(function_exists('iconv')) { if(function_exists('iconv')) {
$property->value = str_replace("\r\n", "\n", iconv(mb_detect_encoding($property->value, 'UTF-8, ISO-8859-1'), 'utf-8', $property->value)); $property->value = str_replace("\r\n", "\n", iconv(mb_detect_encoding($property->value, 'UTF-8, ISO-8859-1'), 'utf-8', $property->value));
} else {
$property->value = str_replace("\r\n", "\n", mb_convert_encoding($property->value, 'UTF-8', mb_detect_encoding($property->value, 'UTF-8, ISO-8859-1'), $property->value));
} }
if(in_array($property->name, $stringprops)) { if(in_array($property->name, $stringprops)) {
$property->value = strip_tags($property->value); $property->value = strip_tags($property->value);