diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index 49505795b80..32cf3246dcc 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -175,6 +175,22 @@ class addressbook_hooks 'default'=> 'iso-8859-1', ); + $selectCharSet = array( + 'utf-8' => 'UTF-8', + 'iso-8859-1' => 'ISO-8859-1', + ); + + $settings['vcard_charset'] = array( + 'type' => 'select', + 'label' => 'Charset for the vCard export', + 'name' => 'vcard_charset', + 'values' => $selectCharSet, + 'help' => 'Which charset should be used for the vCard export.', + 'xmlrpc' => True, + 'admin' => false, + 'default'=> 'utf-8', + ); + if ($GLOBALS['egw_info']['server']['contact_repository'] != 'ldap') { $settings['private_addressbook'] = array( diff --git a/addressbook/inc/class.addressbook_vcal.inc.php b/addressbook/inc/class.addressbook_vcal.inc.php index 66a04c14760..9c1c89108ca 100644 --- a/addressbook/inc/class.addressbook_vcal.inc.php +++ b/addressbook/inc/class.addressbook_vcal.inc.php @@ -980,9 +980,17 @@ class addressbook_vcal extends addressbook_bo { return false; } + if (isset($GLOBALS['egw_info']['user']['preferences']['addressbook']['vcard_charset'])) + { + $charset = $GLOBALS['egw_info']['user']['preferences']['addressbook']['vcard_charset']; + } + else + { + $charset = 'utf-8'; + } foreach ($ids as $id) { - fwrite($fp,$this->getVCard($id)); + fwrite($fp,$this->getVCard($id, $charset)); } fclose($fp);