From d5d81b36c7a93e815cd6eefcc830128bf99fa5c4 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 25 Oct 2012 18:04:57 +0200 Subject: [PATCH] Check if iconv exists. --- lib/vcard.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vcard.php b/lib/vcard.php index 366d4316..b1a4ec64 100644 --- a/lib/vcard.php +++ b/lib/vcard.php @@ -222,7 +222,9 @@ class VCard { if($upgrade && in_array($property->name, $stringprops)) { self::decodeProperty($property); } - $property->value = str_replace("\r\n", "\n", iconv(mb_detect_encoding($property->value, 'UTF-8, ISO-8859-1'), 'utf-8', $property->value)); + 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)); + } if(in_array($property->name, $stringprops)) { $property->value = strip_tags($property->value); }