Outlook 2007 iCal format

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
kiwicmc
Advanced member
Advanced member
Posts: 51
Joined: Fri Sep 12, 2014 10:06 pm

Outlook 2007 iCal format

Postby kiwicmc » Fri Mar 23, 2007 12:47 am

Just found a bug in the way iCal4j parses Outlook 2007 iCal messages (bug seems to be in MS BTW).
Not sure whether this code is in 4.5, I'm working on the 3.1.4 source.
Zimbra does this in cs.mailbox.calendar.ZCalendar::ZCalendarBuilder::build:
...

CalendarParser parser = new CalendarParserImpl();

...



try {

parser.parse(new UnfoldingReader(reader), handler);



The problem with Outlook 2007 is that it breaks long text lines with this pattern "
" and UnfoldingReader in iCal4J up to release 0.9.20 doesn't handle it. Patching UnfoldingReader with this pattern:



/**

* The pattern used to identify a fold in Mozilla Calendar/Sunbird and KOrganizer.

*/

private static final char[] RELAXED_FOLD_PATTERN_1 = { '
', ' ' };



/**

* The pattern used to identify a fold in Microsoft Outlook 2007.

*/

private static final char[] RELAXED_FOLD_PATTERN_2 = { ' ', '
', ' ' };







Fixes the problem. Interestingly enough Outlook 2003 just didn't bother breaking up the lines at all ....



Regards,

Chris


jhahm
Advanced member
Advanced member
Posts: 57
Joined: Fri Sep 12, 2014 9:55 pm

Outlook 2007 iCal format

Postby jhahm » Fri Mar 23, 2007 3:17 pm

Hi, Chris. Thanks for the suggestion. Your fix is basically correct, but we need to also deal with LF-tab. So there are total 4 cases: CRLF-space, LF-space, CRLF-tab, and LF-tab.
See comment #6 in bug 15506.
http://bugzilla.zimbra.com/show_bug.cgi?id=15506

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 6 guests