using iso-8859-1 for talking to SoGo Connector (0.61 works) via GroupDAV

This commit is contained in:
Ralf Becker 2008-04-22 08:55:18 +00:00
parent 82e4a81bc8
commit 3ef9def241

View File

@ -40,10 +40,10 @@ class vcaladdressbook extends bocontacts
* return a vcard * return a vcard
* *
* @param int/string $_id the id of the contact * @param int/string $_id the id of the contact
* @param int $_vcardProfile profile id for mapping from vcard values to egw addressbook * @param string $_charset='utf-8' encoding of the vcard, default utf-8
* @return string containing the vcard * @return string containing the vcard
*/ */
function getVCard($_id) function getVCard($_id,$_charset='utf-8')
{ {
require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar/vcard.php'); require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar/vcard.php');
@ -109,11 +109,11 @@ class vcaladdressbook extends bocontacts
default: default:
if(!empty($value)) if(!empty($value))
{ {
$value = $GLOBALS['egw']->translation->convert(trim($value), $sysCharSet, 'utf-8'); $value = $GLOBALS['egw']->translation->convert(trim($value), $sysCharSet,$_charset);
if(preg_match('/([\177-\377])/',$valueData)) if(preg_match('/([\177-\377])/',$valueData))
{ {
$options['CHARSET'] = 'UTF-8'; $options['CHARSET'] = $_charset;
$options['ENCODING'] = 'QUOTED-PRINTABLE'; $options['ENCODING'] = 'QUOTED-PRINTABLE';
} }
elseif(preg_match('/([\000-\012\015\016\020-\037\075])/',$value)) elseif(preg_match('/([\000-\012\015\016\020-\037\075])/',$value))