【问题标题】:Outlook iCal meeting invitation description issueOutlook iCal 会议邀请说明问题
【发布时间】:2015-04-14 08:08:39
【问题描述】:

我正在使用php 发送iCal event 邀请。一切都以正确的方式显示,RVSP 按钮显示正确。但是descriptionfirst 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


【解决方案1】:

要扩展 Dmitry 的解释,您需要参考 RFC5545,它指定了 iCalendar 格式

[3.1.内容行][1]

iCalendar 对象被组织成单独的文本行, 称为内容行。内容行由换行符分隔, 这是一个 CRLF 序列(CR 字符后跟 LF 字符)。

文本行不应超过 75 个八位字节,不包括行 休息。长内容行应该分成多行 使用线“折叠”技术的表示。也就是说,长 可以通过插入 CRLF 在任意两个字符之间分割行 紧随其后的是一个线性空白字符(即 空间或 HTAB)。

回到您的问题,就像 Dmitry 建议的那样,您应该在 CRLF 之后添加 TABSPACE,但您还应该确保您的行不超过 75 字节。 [1]:https://www.rfc-editor.org/rfc/rfc5545#section-3.1

【讨论】:

  • 你能给我发一些使用php的例子吗?
  • 我不会在 php 中编码,也许您可​​以分享 ical 文件以帮助查看输出中的问题
  • 我已经发布了 ics 文件的详细信息。请看一下。
  • 能否添加代码 sn-p 与行折叠以查看失败的原因
  • 我的意思是带有折叠线的 .ics 文件,因为我没有运行 php 设置来测试您的代码
【解决方案2】:

确保第二行以制表符 (0x9) 开头 - 这样行将正确展开。

【讨论】:

  • 你能给我一些提示在 php 中找到 75 个八位字节并添加选项卡 (0x9) 吗?
  • 你已经不换行了吗?如果不这样做,则必须对换行符进行编码 - 用 \n 替换它们。
  • 另外,如果您有具体的代码问题,请贴出您代码的相关sn-ps,并明确指出问题所在。
  • 我已经指定了代码sn-p。请检查一下。
  • 我不使用 PHP,所以对我来说看起来还可以...您可以单步执行您的代码吗?究竟什么不起作用?
猜你喜欢
  • 1970-01-01
  • 2018-04-09
  • 2015-10-06
  • 1970-01-01
  • 1970-01-01
  • 2018-10-04
  • 1970-01-01
  • 2019-06-04
  • 2021-12-29
相关资源
最近更新 更多