【发布时间】:2015-04-14 08:08:39
【问题描述】:
我正在使用php 发送iCal event 邀请。一切都以正确的方式显示,RVSP 按钮显示正确。但是description 在first line 之后是cutting down。例如,如果我的描述是:
The problem occurs when I have multiple lines in the description.
If it contains the text for example I will only get in my outlook calendar
description. The part after disappears.
唯一的第一行显示如下:
The problem occurs when I have multiple lines in the description.
如果有人帮助我。 我已经换行了,但是在第一行之后它不会显示。这是代码sn-p。
function ical_split($preamble, $value) {
$value = trim($value);
$value = strip_tags($value);
$value = preg_replace('/\n+/', ' ', $value);
$value = preg_replace('/\s{2,}/', ' ', $value);
$preamble_len = strlen($preamble);
$lines = array();
while (strlen($value)>(74-$preamble_len)) {
$space = (74-$preamble_len);
$mbcc = $space;
while ($mbcc) {
$line = mb_substr($value, 0, $mbcc);
$oct = strlen($line);
if ($oct > $space) {
$mbcc -= $oct-$space;
}
else {
$lines[] = $line;
$preamble_len = 1; // Still take the tab into account
$value = mb_substr($value, $mbcc);
break;
}
}
}
if (!empty($value)) {
$lines[] = $value;
}
return join($lines, "\\n\\t");
}
我这样称呼它:
$meeting_notes="The problem occurs when I have multiple lines in the description. If it contains the text for example I will only get in my outlook calendar description. The part after disappears."
ical_split('DESCRIPTION:', $meeting_notes)
这里附上ics文件的详细信息。
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20150227T163000Z
DTEND:20150227T173000Z
DTSTAMP:20150211T094306Z
ORGANIZER;CN=Charlene Switzer:MAILTO:email_here
UID:40
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=name_here;X-NUM-GUESTS=0:MAILTO:email_here
DESCRIPTION:The problem occurs when I have multiple lines in the description. If it contains the text for example I will only get in my outlook calendar description. The part after disappears.
LOCATION:asdf asd
SEQUENCE:0
STATUS:CONFIRMED
TRANSP:OPAQUE
SUMMARY:Meeting
PRIORITY:5
CLASS:PUBLIC
BEGIN:VTIMEZONE
TZID:Eastern
END:VTIMEZONE
END:VEVENT
END:VCALENDAR
【问题讨论】:
-
我对您的问题进行了一些格式化 - 看起来您尝试了各种代码标记可能性(反引号、引号、代码 sn-ps、缩进):-)
标签: email events outlook icalendar rfc5545