Outlook iCal 会议邀请描述问题
Outlook iCal meeting invitation description issue
我正在使用 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.
如果有人帮助我。
我已经换行但是在第一行之后它不会显示。这是代码片段。
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
确保第二行以制表符 (0x9) 开头 - 这样行将被正确展开。
为了扩展 Dmitry 的解释,您需要参考指定 iCalendar 格式的 RFC5545
[3.1.内容行][1]
The iCalendar object is organized into individual lines of text,
called content lines. Content lines are delimited by a line break,
which is a CRLF sequence (CR character followed by LF character).
Lines of text SHOULD NOT be longer than 75 octets, excluding the line
break. Long content lines SHOULD be split into a multiple line
representations using a line "folding" technique. That is, a long
line can be split between any two characters by inserting a CRLF
immediately followed by a single linear white-space character (i.e.,
SPACE or HTAB).
所以回到你的问题,就像 Dmitry 的建议一样,你应该在 CRLF 之后添加一个 TAB
或 SPACE
,但你也应该确保你的行不超过 75 字节。
[1]: https://www.rfc-editor.org/rfc/rfc5545#section-3.1
我正在使用 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.
如果有人帮助我。 我已经换行但是在第一行之后它不会显示。这是代码片段。
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
确保第二行以制表符 (0x9) 开头 - 这样行将被正确展开。
为了扩展 Dmitry 的解释,您需要参考指定 iCalendar 格式的 RFC5545
[3.1.内容行][1]
The iCalendar object is organized into individual lines of text, called content lines. Content lines are delimited by a line break, which is a CRLF sequence (CR character followed by LF character).
Lines of text SHOULD NOT be longer than 75 octets, excluding the line break. Long content lines SHOULD be split into a multiple line representations using a line "folding" technique. That is, a long line can be split between any two characters by inserting a CRLF immediately followed by a single linear white-space character (i.e., SPACE or HTAB).
所以回到你的问题,就像 Dmitry 的建议一样,你应该在 CRLF 之后添加一个 TAB
或 SPACE
,但你也应该确保你的行不超过 75 字节。
[1]: https://www.rfc-editor.org/rfc/rfc5545#section-3.1