[eGroupWare-svn] r55929 - in /branches/14.2: addressbook/ addressbook/inc/ addressbook/js/ calendar/ calendar/inc/ emailadmin/inc/ infolog/ i...

[email protected] Fri, 29 Apr 2016 08:49:36 -0000
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: ralfbecker
Date: Fri Apr 29 10:49:36 2016
New Revision: 55929

URL: http://svn.stylite.de/viewvc/egroupware?rev=55929&view=rev
Log:
* Mail/Addressbook/Calendar: add and use charset when sending/receiving mails with vCard/iCals, change default vCard charset preference to utf-8

Modified:
    branches/14.2/addressbook/   (props changed)
    branches/14.2/addressbook/inc/class.addressbook_hooks.inc.php
    branches/14.2/addressbook/inc/class.addressbook_vcal.inc.php
    branches/14.2/addressbook/js/app.js
    branches/14.2/calendar/   (props changed)
    branches/14.2/calendar/inc/class.calendar_ical.inc.php
    branches/14.2/emailadmin/inc/class.emailadmin_imapbase.inc.php
    branches/14.2/infolog/   (props changed)
    branches/14.2/infolog/inc/class.infolog_ical.inc.php   (contents, props changed)
    branches/14.2/mail/   (props changed)
    branches/14.2/mail/inc/class.mail_compose.inc.php   (contents, props changed)
    branches/14.2/mail/inc/class.mail_ui.inc.php   (contents, props changed)
    branches/14.2/phpgwapi/inc/class.egw_ical_iterator.inc.php
    branches/14.2/phpgwapi/inc/class.egw_mailer.inc.php

Propchange: branches/14.2/addressbook/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 29 10:49:36 2016
@@ -1,1 +1,1 @@
-/trunk/addressbook:51376,51455,51563-51564,51566,51568,51584,51768,51812,51817,51953,51980,52009,52042,52174,52292,52351,52362,52420,52425,52453,52504,52511,52546,52613,52633,52817,52837,52898,52903,52971-52973,52983-52988,53006,53156,53163,53196,53209,53245,53413,53427,53491,53580,53607,53623,53639,53678,53684,53708-53709,53733,53749,53863,53964,54010,54293,54373,54557,54560,54578,54710,54782,54795-54797,54856,55560,55884,55888
+/trunk/addressbook:51376,51455,51563-51564,51566,51568,51584,51768,51812,51817,51953,51980,52009,52042,52174,52292,52351,52362,52420,52425,52453,52504,52511,52546,52613,52633,52817,52837,52898,52903,52971-52973,52983-52988,53006,53156,53163,53196,53209,53245,53413,53427,53491,53580,53607,53623,53639,53678,53684,53708-53709,53733,53749,53863,53964,54010,54293,54373,54557,54560,54578,54710,54782,54795-54797,54856,55560,55884,55888,55926

Modified: branches/14.2/addressbook/inc/class.addressbook_hooks.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/addressbook/inc/class.addressbook_hooks.inc.php?rev=55929&r1=55928&r2=55929&view=diff
==============================================================================
--- branches/14.2/addressbook/inc/class.addressbook_hooks.inc.php (original)
+++ branches/14.2/addressbook/inc/class.addressbook_hooks.inc.php Fri Apr 29 10:49:36 2016
@@ -302,7 +302,7 @@
 				'help'   => 'Which charset should be used for the vCard import and export.',
 				'xmlrpc' => True,
 				'admin'  => false,
-				'default'=> 'iso-8859-1',
+				'default'=> 'utf-8',
 			);
 		}
 		return $settings;

Modified: branches/14.2/addressbook/inc/class.addressbook_vcal.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/addressbook/inc/class.addressbook_vcal.inc.php?rev=55929&r1=55928&r2=55929&view=diff
==============================================================================
--- branches/14.2/addressbook/inc/class.addressbook_vcal.inc.php (original)
+++ branches/14.2/addressbook/inc/class.addressbook_vcal.inc.php Fri Apr 29 10:49:36 2016
@@ -14,7 +14,6 @@
 
 /**
  * Addressbook - vCard parser
- *
  */
 class addressbook_vcal extends addressbook_bo
 {
@@ -555,11 +554,17 @@
 			$container = false;
 			$vCard = Horde_Icalendar::newComponent('vcard', $container);
 
-			if (!$vCard->parsevCalendar($_vcard, 'VCARD', $charset))
+			if ($charset && $charset != 'utf-8')
+			{
+				$_vcard = translation::convert($_vcard, $charset, 'utf-8');
+			}
+			if (!$vCard->parsevCalendar($_vcard, 'VCARD'))
 			{
 				return False;
 			}
-		} else {
+		}
+		else
+		{
 			$vCard = $_vcard;
 		}
 		$vcardValues = $vCard->getAllAttributes();

Modified: branches/14.2/addressbook/js/app.js
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/addressbook/js/app.js?rev=55929&r1=55928&r2=55929&view=diff
==============================================================================
--- branches/14.2/addressbook/js/app.js (original)
+++ branches/14.2/addressbook/js/app.js Fri Apr 29 10:49:36 2016
@@ -186,7 +186,7 @@
 				extras.owner.push('c'+ids);
 			}
 		}
-		
+
 		if(orgs.length > 0)
 		{
 			// Get organisation contacts, then show infolog list
@@ -660,13 +660,13 @@
 	adb_mail_vcard: function(_action, _elems)
 	{
 		var app_registry = egw.link_get_registry('mail');
-		if (typeof app_registry['view'] == 'undefined') app_registry = egw.link_get_registry('felamimail');
 		var link = egw().link("/index.php","menuaction="+app_registry['add']['menuaction']);
 		for (var i = 0; i < _elems.length; i++)
 		{
 			var idToUse = _elems[i].id;
 			var idToUseArray = idToUse.split('::');
 			idToUse = idToUseArray[1];
+			link += "&preset[type][]="+encodeURIComponent("text/vcard; charset="+(egw.preference('vcard_charset', 'addressbook') || 'utf-8'));
 			link += "&preset[file][]="+encodeURIComponent("vfs://default/apps/addressbook/"+idToUse+"/.entry");
 		}
 		if (typeof app_registry['view'] != 'undefined' && typeof app_registry['view_popup'] != 'undefined' )
@@ -859,7 +859,7 @@
 				break;
 		}
 	},
-	
+
 	/**
 	 * Get title in order to set it as document title
 	 * @returns {string}

Propchange: branches/14.2/calendar/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 29 10:49:36 2016
@@ -1,2 +1,2 @@
 /branches/Stylite-EPL-11.1/calendar:51445
-/trunk/calendar:51362,51371,51376,51394,51400,51456,51474,51540,51547,51569,51573,51592,51596,51614,51812,51817,51844,51846,51848,51850,51901,51936,51953,52018,52020,52060,52085,52114,52116,52118-52119,52216,52249,52252,52284,52338,52347,52362,52408,52413,52416,52434,52463,52469,52506,52509,52536,52593,52658,52672,52695,52834,52931,52933,52971-52973,52983-52988,53008,53084,53087,53116,53118,53120,53146-53147,53155,53176,53178,53194,53258,53421,53496,53500,53534,53536,53577,53620,53668,53703,53724-53725,53742,53752,53755,53757,53759,53781-53782,53833,53836,53870,53892,53894,53900,53910,53950,53989,54152,54154,54201,54225,54263,54273,54275,54287,54335,54367,54376,54557-54558,54691,54741,54754,54887,55051,55344,55526,55859,55896
+/trunk/calendar:51362,51371,51376,51394,51400,51456,51474,51540,51547,51569,51573,51592,51596,51614,51812,51817,51844,51846,51848,51850,51901,51936,51953,52018,52020,52060,52085,52114,52116,52118-52119,52216,52249,52252,52284,52338,52347,52362,52408,52413,52416,52434,52463,52469,52506,52509,52536,52593,52658,52672,52695,52834,52931,52933,52971-52973,52983-52988,53008,53084,53087,53116,53118,53120,53146-53147,53155,53176,53178,53194,53258,53421,53496,53500,53534,53536,53577,53620,53668,53703,53724-53725,53742,53752,53755,53757,53759,53781-53782,53833,53836,53870,53892,53894,53900,53910,53950,53989,54152,54154,54201,54225,54263,54273,54275,54287,54335,54367,54376,54557-54558,54691,54741,54754,54887,55051,55344,55526,55859,55896,55926

Modified: branches/14.2/calendar/inc/class.calendar_ical.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/calendar/inc/class.calendar_ical.inc.php?rev=55929&r1=55928&r2=55929&view=diff
==============================================================================
--- branches/14.2/calendar/inc/class.calendar_ical.inc.php (original)
+++ branches/14.2/calendar/inc/class.calendar_ical.inc.php Fri Apr 29 10:49:36 2016
@@ -2262,7 +2262,11 @@
 
 		$events = array();
 		$vcal = new Horde_Icalendar;
-		if (!$vcal->parsevCalendar($_vcalData, 'VCALENDAR', $charset))
+		if ($charset && $charset != 'utf-8')
+		{
+			$_vcalData = translation::convert($_vcalData, $charset, 'utf-8');
+		}
+		if (!$vcal->parsevCalendar($_vcalData, 'VCALENDAR'))
 		{
 			if ($this->log)
 			{

Modified: branches/14.2/emailadmin/inc/class.emailadmin_imapbase.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/emailadmin/inc/class.emailadmin_imapbase.inc.php?rev=55929&r1=55928&r2=55929&view=diff
==============================================================================
--- branches/14.2/emailadmin/inc/class.emailadmin_imapbase.inc.php (original)
+++ branches/14.2/emailadmin/inc/class.emailadmin_imapbase.inc.php Fri Apr 29 10:49:36 2016
@@ -5435,7 +5435,7 @@
 
 		return $attachment['attachment'];
 	}
-	
+
 	/**
 	 * Retrieve tnef attachments
 	 *
@@ -5454,7 +5454,7 @@
 		{
 			foreach($tnef_parts->getParts() as $mime_id => $part)
 			{
-				
+
 				$attachment = $part->getAllDispositionParameters();
 				$attachment['mimeType'] = $part->getType();
 				if (!isset($attachment['filename'])||empty($attachment['filename'])) $attachment['filename'] = $part->getName();
@@ -5464,16 +5464,16 @@
 					$attachment['filename'] = (isset($attachment['cid'])&&!empty($attachment['cid'])?
 						$attachment['cid']:lang("unknown").'_Uid'.$_uid.'_Part'.$mime_id).'.'.mime_magic::mime2ext($attachment['mimeType']);
 				}
-				
+
 				$attachment['attachment'] = $part->getContents(array('stream'=>$_stream));
-				
+
 				$attachments[$_uid.'@'.$_partID.'@'.$mime_id] = $attachment;
 			}
 		}
 		if (!is_array($attachments)) return false;
 		return $attachments;
 	}
-	
+
 	/**
 	 * Retrieve a attachment
 	 *
@@ -5520,11 +5520,10 @@
 					if ($part && ($partDisposition=='attachment' || $partDisposition=='inline' || ($part->getPrimaryType() == 'text' && $part->getSubType() == 'calendar')))
 					{
 						//$headerObject=$part->getAllDispositionParameters();//not used anywhere around here
-
-						$structure_bytes = $part->getBytes();
-						$structure_mime=$part->getType();
-						$structure_partID=$part->getMimeId();
-						$filename=$part->getName();
+						$structure_mime = $part->getType();
+						$filename = $part->getName();
+						$charset = $part->getContentTypeParameter('charset');
+						//$structure_bytes = $part->getBytes(); $structure_partID=$part->getMimeId(); error_log(__METHOD__.__LINE__." fetchPartContents(".array2string($_uid).", $structure_partID, $_stream, $_preserveSeen,$structure_mime)" );
 						$this->fetchPartContents($_uid, $part, $_stream, $_preserveSeen=true,$structure_mime);
 						if ($_returnPart) return $part;
 					}
@@ -5539,14 +5538,14 @@
 		}
 		$attachmentData = array(
 			'type'		=> $structure_mime,
+			'charset'   => $charset,
 			'filename'	=> $filename,
-			//'attachment'	=> $part->getContents(array('stream'=>$_stream))
 			'attachment'	=> $part->getContents(array(
 				// tnef_decode needs strings not a stream
 				'stream' => $_stream && !($filename == 'winmail.dat' && $_winmail_nr)
 			)),
 		);
-		
+
 		// try guessing the mimetype, if we get the application/octet-stream
 		if (strtolower($attachmentData['type']) == 'application/octet-stream') $attachmentData['type'] = mime_magic::filename2mime($attachmentData['filename']);
 		# if the attachment holds a winmail number and is a winmail.dat then we have to handle that.
@@ -6719,7 +6718,7 @@
 				$previousFailed=false;
 				//error_log(__METHOD__.__LINE__."('$addresses', $default_domain) parsed $i: mailbox=$adr->mailbox, host=$adr->host, personal=$adr->personal");
 				$ret2->add($adr);
-			}			
+			}
 		}
 		//error_log(__METHOD__.__LINE__.'#'.array2string($addresses).'#'.array2string($ret2).'#'.$ret2->count().'#'.$ret2->count);
 		return $ret2;

Propchange: branches/14.2/infolog/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 29 10:49:36 2016
@@ -1,1 +1,1 @@
-/trunk/infolog:51376,51564,51630,51633,51645-51646,51648,51651,51658,51692,51760,51812,51817,51828,51935,51945-51946,51953,52021,52065,52075,52078,52111,52151,52238,52245,52265,52362,52381,52437,52467,52480,52506,52509,52536,52732,52735,52774,52782,52806,52809,52971-52973,52983-52988,53087,53116,53146-53147,53180,53194,53214,53449,53453,53500,53546,53562,53623,54165,54304,54332,54387,54391,54409,54443,54481,54557,54629,54668,55037-55038,55058,55098,55464,55476
+/trunk/infolog:51376,51564,51630,51633,51645-51646,51648,51651,51658,51692,51760,51812,51817,51828,51935,51945-51946,51953,52021,52065,52075,52078,52111,52151,52238,52245,52265,52362,52381,52437,52467,52480,52506,52509,52536,52732,52735,52774,52782,52806,52809,52971-52973,52983-52988,53087,53116,53146-53147,53180,53194,53214,53449,53453,53500,53546,53562,53623,54165,54304,54332,54387,54391,54409,54443,54481,54557,54629,54668,55037-55038,55058,55098,55464,55476,55926

Modified: branches/14.2/infolog/inc/class.infolog_ical.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/infolog/inc/class.infolog_ical.inc.php?rev=55929&r1=55928&r2=55929&view=diff
==============================================================================
--- branches/14.2/infolog/inc/class.infolog_ical.inc.php (original)
+++ branches/14.2/infolog/inc/class.infolog_ical.inc.php Fri Apr 29 10:49:36 2016
@@ -405,7 +405,7 @@
 						foreach((array)$value as $compvData)
 						{
 							$comp = Horde_Icalendar::newComponent(substr($name,3), $vevent);
-							$comp->parsevCalendar($compvData,substr($name,3),'utf-8');
+							$comp->parsevCalendar($compvData,substr($name,3));
 							$vevent->addComponent($comp);
 						}
 					}
@@ -654,7 +654,11 @@
 		}
 
 		$vcal = new Horde_Icalendar;
-		if (!($vcal->parsevCalendar($_vcalData, 'VCALENDAR', $charset)))
+		if ($charset && $charset != 'utf-8')
+		{
+			$_vcalData = translation::convert($_vcalData, $charset, 'utf-8');
+		}
+		if (!($vcal->parsevCalendar($_vcalData, 'VCALENDAR')))
 		{
 			if ($this->log)
 			{
@@ -1096,7 +1100,11 @@
 
 			case 'text/x-vnote':
 				$vnote = new Horde_Icalendar;
-				if (!$vnote->parsevCalendar($_data, 'VCALENDAR', $charset))	return false;
+				if ($charset && $charset != 'utf-8')
+				{
+					$_data = translation::convert($_data, $charset, 'utf-8');
+				}
+				if (!$vnote->parsevCalendar($_data, 'VCALENDAR'))	return false;
 
 				$components = $vnote->getComponent();
 				foreach ($components as $component)

Propchange: branches/14.2/infolog/inc/class.infolog_ical.inc.php
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 29 10:49:36 2016
@@ -1,1 +1,1 @@
-/trunk/infolog/inc/class.infolog_ical.inc.php:52971-52973,52983-52988,53194
+/trunk/infolog/inc/class.infolog_ical.inc.php:52971-52973,52983-52988,53194,55926

Propchange: branches/14.2/mail/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 29 10:49:36 2016
@@ -1,1 +1,1 @@
-/trunk/mail:51376,51407,51521,51526-51528,51564,51608,51615,51676,51716-51717,51725,51728,51742,51779,51782,51788,51812,51817,51851,51853,51890,51915,51956,51969-51970,51995,52003,52026,52040,52044,52084,52162,52185-52186,52208,52214,52225,52227,52252,52255,52268,52295,52303,52305,52308,52326,52355,52358,52360,52362,52386,52445,52475,52506-52509,52516,52536,52545,52549,52553,52577,52581,52627-52628,52638,52640,52643,52668,52722-52723,52741,52743,52745,52757,52760,52763,52770,52772,52775,52778,52812,52860,52865,52870,52881,52889,52898,52903,52927,52947,52975,53013,53063,53071,53118,53151,53153,53158,53165,53172,53181,53190-53191,53213,53219,53228-53229,53239,53250,53256,53261,53263,53276,53281,53284,53297-53298,53300,53304-53305,53307-53308,53313,53325,53329,53332,53335,53342-53343,53353,5
 3370,53372-53373,53380,53383,53436,53463,53533,53538,53573,53636,53673,53681,53686,53697,53706,53727,53737,53741,53789,53814,53842,53983,54001-54002,54051-54052,54060,54066,54150,54169,54241-54242,5
 4331,54361,54392,54395,54397,54404,54432-54433,54489,54656-54657,54666
+/trunk/mail:51376,51407,51521,51526-51528,51564,51608,51615,51676,51716-51717,51725,51728,51742,51779,51782,51788,51812,51817,51851,51853,51890,51915,51956,51969-51970,51995,52003,52026,52040,52044,52084,52162,52185-52186,52208,52214,52225,52227,52252,52255,52268,52295,52303,52305,52308,52326,52355,52358,52360,52362,52386,52445,52475,52506-52509,52516,52536,52545,52549,52553,52577,52581,52627-52628,52638,52640,52643,52668,52722-52723,52741,52743,52745,52757,52760,52763,52770,52772,52775,52778,52812,52860,52865,52870,52881,52889,52898,52903,52927,52947,52975,53013,53063,53071,53118,53151,53153,53158,53165,53172,53181,53190-53191,53213,53219,53228-53229,53239,53250,53256,53261,53263,53276,53281,53284,53297-53298,53300,53304-53305,53307-53308,53313,53325,53329,53332,53335,53342-53343,53353,5
 3370,53372-53373,53380,53383,53436,53463,53533,53538,53573,53636,53673,53681,53686,53697,53706,53727,53737,53741,53789,53814,53842,53983,54001-54002,54051-54052,54060,54066,54150,54169,54241-54242,5
 4331,54361,54392,54395,54397,54404,54432-54433,54489,54656-54657,54666,55926

Modified: branches/14.2/mail/inc/class.mail_compose.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/mail/inc/class.mail_compose.inc.php?rev=55929&r1=55928&r2=55929&view=diff
==============================================================================
--- branches/14.2/mail/inc/class.mail_compose.inc.php (original)
+++ branches/14.2/mail/inc/class.mail_compose.inc.php Fri Apr 29 10:49:36 2016
@@ -893,6 +893,11 @@
 							{
 								$name .= '.'.mime_magic::mime2ext($type);
 							}
+							// use type specified by caller, if Vfs reports only default, or contains specified type (eg. "text/vcard; charset=utf-8")
+							if (!empty($types[$k]) && ($type == 'application/octet-stream' || stripos($types[$k], $type) === 0))
+							{
+								$type = $types[$k];
+							}
 							$path = str_replace('+','%2B',$path);
 							$formData = array(
 								'name' => $name,

Propchange: branches/14.2/mail/inc/class.mail_compose.inc.php
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 29 10:49:36 2016
@@ -1,1 +1,1 @@
-/trunk/mail/inc/class.mail_compose.inc.php:51376,51407,51521,51526-51528,51564,51608,51615,51676,51716-51717,51725,51728,51742,51779,51782,51788,51812,51817,51851,51853,51890,51915,51956,51969-51970,51995,52003,52026,52040,52044,52084,52162,52185-52186,52208,52214,52225,52227,52252,52255,52268,52295,52303,52305,52308,52326,52355,52358,52360,52362,52386,52445,52475,52506-52509,52516,52536,52545,52549,52553,52577,52581,52627-52628,52638,52640,52643,52668,52722-52723,52741,52743,52745,52757,52760,52763,52770,52772,52775,52778,52812,52860,52865,52870,52881,52889,52898,52903,52927,52947,52975,53013,53063,53071,53118,53151,53153,53158,53165,53172,53181,53190-53191,53213,53219,53228-53229,53239,53250,53256,53261,53263,53276,53281,53284,53297-53298,53300,53304-53305,53307-53308,53313,53325,53329,
 53332,53335,53342-53343,53353,53370,53372-53373,53380,53383,53436,53463,53533,53538,53573,53636,53673,53681,53686,53697,53706,53727,53737,53741,53789,53814,53842,53983,54001-54002,54024,54060,54150,
 54169,54361,54660
+/trunk/mail/inc/class.mail_compose.inc.php:51376,51407,51521,51526-51528,51564,51608,51615,51676,51716-51717,51725,51728,51742,51779,51782,51788,51812,51817,51851,51853,51890,51915,51956,51969-51970,51995,52003,52026,52040,52044,52084,52162,52185-52186,52208,52214,52225,52227,52252,52255,52268,52295,52303,52305,52308,52326,52355,52358,52360,52362,52386,52445,52475,52506-52509,52516,52536,52545,52549,52553,52577,52581,52627-52628,52638,52640,52643,52668,52722-52723,52741,52743,52745,52757,52760,52763,52770,52772,52775,52778,52812,52860,52865,52870,52881,52889,52898,52903,52927,52947,52975,53013,53063,53071,53118,53151,53153,53158,53165,53172,53181,53190-53191,53213,53219,53228-53229,53239,53250,53256,53261,53263,53276,53281,53284,53297-53298,53300,53304-53305,53307-53308,53313,53325,53329,
 53332,53335,53342-53343,53353,53370,53372-53373,53380,53383,53436,53463,53533,53538,53573,53636,53673,53681,53686,53697,53706,53727,53737,53741,53789,53814,53842,53983,54001-54002,54024,54060,54150,
 54169,54361,54660,55926

Modified: branches/14.2/mail/inc/class.mail_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/mail/inc/class.mail_ui.inc.php?rev=55929&r1=55928&r2=55929&view=diff
==============================================================================
--- branches/14.2/mail/inc/class.mail_ui.inc.php (original)
+++ branches/14.2/mail/inc/class.mail_ui.inc.php Fri Apr 29 10:49:36 2016
@@ -2309,7 +2309,7 @@
 				$eventid = $calendar_ical->search($attachment['attachment'],-1);
 				//error_log(__METHOD__.array2string($eventid));
 				if (!$eventid) $eventid = -1;
-				$event = $calendar_ical->importVCal($attachment['attachment'],(is_array($eventid)?$eventid[0]:$eventid),null,true);
+				$event = $calendar_ical->importVCal($attachment['attachment'],(is_array($eventid)?$eventid[0]:$eventid),null,true,0,'',null,$attachment['charset']);
 				//error_log(__METHOD__.$event);
 				if ((int)$event > 0)
 				{
@@ -2327,7 +2327,7 @@
 				// double \r\r\n seems to end a vcard prematurely, so we set them to \r\n
 				//error_log(__METHOD__.__LINE__.$attachment['attachment']);
 				$attachment['attachment'] = str_replace("\r\r\n", "\r\n", $attachment['attachment']);
-				$vcard = $addressbook_vcal->vcardtoegw($attachment['attachment']);
+				$vcard = $addressbook_vcal->vcardtoegw($attachment['attachment'], $attachment['charset']);
 				if ($vcard['uid'])
 				{
 					$vcard['uid'] = trim($vcard['uid']);
@@ -2338,7 +2338,7 @@
 				// if there are not enough fields in the vcard (or the parser was unable to correctly parse the vcard (as of VERSION:3.0 created by MSO))
 				if ($contact || count($vcard)>2)
 				{
-					$contact = $addressbook_vcal->addVCard($attachment['attachment'],(is_array($contact)?array_shift($contact):$contact),true);
+					$contact = $addressbook_vcal->addVCard($attachment['attachment'],(is_array($contact)?array_shift($contact):$contact),true,$attachment['charset']);
 				}
 				if ((int)$contact > 0)
 				{

Propchange: branches/14.2/mail/inc/class.mail_ui.inc.php
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 29 10:49:36 2016
@@ -1,1 +1,1 @@
-/trunk/mail/inc/class.mail_ui.inc.php:51376,51407,51521,51526-51528,51564,51608,51615,51676,51716-51717,51725,51728,51742,51779,51782,51788,51812,51817,51851,51853,51890,51915,51956,51969-51970,51995,52003,52026,52040,52044,52084,52162,52185-52186,52208,52214,52225,52227,52252,52255,52268,52295,52303,52305,52308,52326,52355,52358,52360,52362,52386,52445,52475,52506-52509,52516,52536,52545,52549,52553,52577,52581,52627-52628,52638,52640,52643,52668,52722-52723,52741,52743,52745,52757,52760,52763,52770,52772,52775,52778,52812,52860,52865,52870,52881,52889,52898,52903,52927,52947,52975,53013,53063,53071,53118,53151,53153,53158,53165,53172,53181,53190-53191,53213,53219,53228-53229,53239,53250,53256,53261,53263,53276,53281,53284,53297-53298,53300,53304-53305,53307-53308,53313,53325,53329,53332
 ,53335,53342-53343,53353,53370,53372-53373,53380,53383,53436,53463,53533,53538,53573,53636,53673,53681,53686,53697,53706,53727,53737,53741,53789,53814,53842,53983,54001-54002,54024,54051,54060,54331
 ,54392,54432-54433,54672,54700,54883
+/trunk/mail/inc/class.mail_ui.inc.php:51376,51407,51521,51526-51528,51564,51608,51615,51676,51716-51717,51725,51728,51742,51779,51782,51788,51812,51817,51851,51853,51890,51915,51956,51969-51970,51995,52003,52026,52040,52044,52084,52162,52185-52186,52208,52214,52225,52227,52252,52255,52268,52295,52303,52305,52308,52326,52355,52358,52360,52362,52386,52445,52475,52506-52509,52516,52536,52545,52549,52553,52577,52581,52627-52628,52638,52640,52643,52668,52722-52723,52741,52743,52745,52757,52760,52763,52770,52772,52775,52778,52812,52860,52865,52870,52881,52889,52898,52903,52927,52947,52975,53013,53063,53071,53118,53151,53153,53158,53165,53172,53181,53190-53191,53213,53219,53228-53229,53239,53250,53256,53261,53263,53276,53281,53284,53297-53298,53300,53304-53305,53307-53308,53313,53325,53329,53332
 ,53335,53342-53343,53353,53370,53372-53373,53380,53383,53436,53463,53533,53538,53573,53636,53673,53681,53686,53697,53706,53727,53737,53741,53789,53814,53842,53983,54001-54002,54024,54051,54060,54331
 ,54392,54432-54433,54672,54700,54883,55926

Modified: branches/14.2/phpgwapi/inc/class.egw_ical_iterator.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/phpgwapi/inc/class.egw_ical_iterator.inc.php?rev=55929&r1=55928&r2=55929&view=diff
==============================================================================
--- branches/14.2/phpgwapi/inc/class.egw_ical_iterator.inc.php (original)
+++ branches/14.2/phpgwapi/inc/class.egw_ical_iterator.inc.php Fri Apr 29 10:49:36 2016
@@ -248,8 +248,12 @@
         	return;
             //return PEAR::raiseError("Unable to create object for type $type");
         }
+		if ($this->charset && $this->charset != 'utf-8')
+		{
+			$data = Api\Translation::convert($data, $this->charset, 'utf-8');
+		}
 		//error_log(__METHOD__."() about to call parsevCalendar('".substr($data,0,100)."...','$type','$this->charset')");
-		$this->component->parsevCalendar($data, $type, $this->charset);
+		$this->component->parsevCalendar($data, $type);
 
 		// VTIMEZONE components are NOT returned, they are only processed internally
 		if ($type == 'VTIMEZONE')

Modified: branches/14.2/phpgwapi/inc/class.egw_mailer.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/phpgwapi/inc/class.egw_mailer.inc.php?rev=55929&r1=55928&r2=55929&view=diff
==============================================================================
--- branches/14.2/phpgwapi/inc/class.egw_mailer.inc.php (original)
+++ branches/14.2/phpgwapi/inc/class.egw_mailer.inc.php Fri Apr 29 10:49:36 2016
@@ -306,18 +306,17 @@
 	 *
 	 * @param string|resource $data Path to the attachment or open file-descriptor
 	 * @param string $name     The file name to use for the attachment.
-	 * @param string $type     The content type of the file.
-	 * @param string $charset  The character set of the part, only relevant for text parts.
+	 * @param string $type =null content type of the file, incl. parameters eg. "text/plain; charset=utf-8"
+	 * @param string $old_type =null used to support phpMailer signature (deprecated)
 	 * @return integer part-number
 	 * @throws egw_exception_not_found if $file could not be opened for reading
 	 */
-	public function addAttachment($data, $name = null, $type = null, $charset = 'us-ascii')
+	public function addAttachment($data, $name = null, $type = null, $old_type=null)
 	{
 		// deprecated PHPMailer::AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') call
 		if ($type === 'base64')
 		{
-			$type = $charset;
-			$charset = 'us-ascii';
+			$type = $old_type;
 		}
 
 		// pass file as resource to Horde_Mime_Part::setContent()
@@ -342,6 +341,14 @@
 
 		$part = new Horde_Mime_Part();
 		$part->setType($type);
+		// set content-type parameters, which get ignored by setType
+		if (preg_match_all('/;\s*([^=]+)=([^;]*)/', $type, $matches))
+		{
+			foreach($matches[1] as $n => $label)
+			{
+				$part->setContentTypeParameter($label, $matches[2][$n]);
+			}
+		}
 		$part->setContents($resource);
 
 		// setting name, also sets content-disposition attachment (!), therefore we have to do it after "text/calendar; method=" handling
@@ -349,7 +356,7 @@
 
 		// this should not be necessary, because binary data get detected by mime-type,
 		// but at least Cyrus complains about NUL characters
-		$part->setTransferEncoding('base64', array('send' => true));
+		if (substr($type, 0, 5) != 'text/') $part->setTransferEncoding('base64', array('send' => true));
 		$part->setDisposition('attachment');
 
 		return $this->addMimePart($part);


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z