Bug 182224 - iCalendar format broken, iCal export broken: missing LF at EOF
Summary: iCalendar format broken, iCal export broken: missing LF at EOF
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 182913 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-28 23:54 UTC by pablo funes
Modified: 2009-02-03 14:40 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
icalendar file exported with a patch korganizer (6.21 KB, text/calendar)
2009-02-02 22:25 UTC, Sergio Martins
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pablo funes 2009-01-28 23:54:01 UTC
Version:           kdepim-4.1.4-1.fc10.i386  (using KDE 4.1.4)
Compiler:           gcc-4.3.2-7.i386
OS:                Linux
Installed from:    Fedora RPMs

.ics files saved by kOrganizer terminate all lines with CR LF (ascii 13 followed by 10) as in the DOS standard. The last line however, lacks the final LF. This error prevents Apple iCal from importing kOrganizer calendars. Text editors complain that the file is missing an end-of-line.
Comment 1 Sergio Martins 2009-01-29 00:56:35 UTC
I confirm the file ends with CR LF CR
Comment 2 pablo funes 2009-01-29 04:38:00 UTC
With this bug in, trying to import any KOrganizer calendar to Apple iCal (Version 3.0.6 (1273)) fails with the following error: 

"This calendar file is unreadable. No events have been added to your iCal calendar."

A workaround is to open the file with a text editor and simply save it without making any changes. It works with Vim, which quietly fixes the problem line. 

However, the calendars I publish from my KOrganizer are no longer readable by my iCal subscribers :-(

Comment 3 pablo funes 2009-01-30 17:31:00 UTC
Update: bug still present in KOrganizer 4.2 rc1

Here's a sample ASCII dump. You can see the last END:VEVENT line ends with cr nl but the final END:VCALENDAR line lacks the nl. 

0000720   A   Q   U   E  cr  nl   E   N   D   :   V   E   V   E   N   T
0000740  cr  nl   E   N   D   :   V   C   A   L   E   N   D   A   R  cr
Comment 4 Sergio Martins 2009-02-02 20:14:41 UTC
*** Bug 182913 has been marked as a duplicate of this bug. ***
Comment 5 Sergio Martins 2009-02-02 22:25:52 UTC
Created attachment 30882 [details]
icalendar file exported with a patch korganizer

Can any reporters test if this file opens fine?

It ends with \r\n\r\n
Comment 6 Marc Blanchet 2009-02-02 23:37:50 UTC
attachment imported just fine in ical Version 3.0.6 (1273) (most current version).
I see an event on feb 4th 4h00am in the morning.
looks fixed to me.
Comment 7 Simon Perreault 2009-02-02 23:54:39 UTC
Note that a single \r\n should be sufficient, according to the RFC.
Comment 8 Sergio Martins 2009-02-03 00:15:24 UTC
(In reply to comment #7)
> Note that a single \r\n should be sufficient, according to the RFC.

Yeah, it is, but that's an upstream "bug" (I think it doesn't harm though), not KDE's.

IMHO the best is to commit the korganizer's bug (the \n that was being eaten) and mail the libical devs about the double end of line.


Comment 9 Sergio Martins 2009-02-03 02:03:34 UTC
SVN commit 920488 by smartins:

Fix a Qt4 porting bug. No need to discard the last byte as it's not a NUL anymore.

BUG: 182224


 M  +1 -1      icalformat.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=920488
Comment 10 Simon Perreault 2009-02-03 14:40:39 UTC
SVN commit 920617 by perreaul:

Fix a Qt4 porting bug. No need to discard the last byte as it's not a NUL anymore.

BUG: 182224


 M  +1 -1      icalformat.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=920617