Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing ics Events with Comma in SUMMARY/DESCRIPTION fields #60

Closed
bekoeppel opened this issue Feb 8, 2013 · 3 comments
Closed

Importing ics Events with Comma in SUMMARY/DESCRIPTION fields #60

bekoeppel opened this issue Feb 8, 2013 · 3 comments

Comments

@bekoeppel
Copy link

I'm trying to import a .ics file. The SUMMARY and DESCRIPTION fields contain commas. The event is imported successfully, but SUMMARY and DESCRIPTION are only parsed until the first comma.

This is my .ics file I try to import:

[beni@lilobster:~]$ cat Downloads/SBBVerbindung\ \(9\).ics
BEGIN:VCALENDAR
VERSION:2.0
PRODID:http://www.hacon.de
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:hafas1747939549
CLASS:PUBLIC
SUMMARY:Zürich, Kalkbreite -> Trimmis, Churweg
DTSTART;TZID=Europe/Berlin:20130208T191800
DTEND;TZID=Europe/Berlin:20130208T205800
DTSTAMP:20130208T121500Z
URL:http://fahrplan.sbb.ch/bin/query.exe/dn?S=Z%FCrich,%20Kalkbreite&Z=Trimmis,%20Churweg&date=08.02.13&time=19%3A18&
DESCRIPTION:Reise: Zürich, Kalkbreite nach Trimmis, Churweg\nDatum: 08.02.13\n-\nab 19:18 Zürich, Kalkbreite  (Tram 2, Richtung: Zürich Tiefenbrunnen, Bahnhof)\nan 19:20 Zürich, Stauffacher \n\nab 19:22 Zürich, Stauffacher  (Tram 14, Richtung: Zürich, Seebach)\nan 19:27 Zürich, Bahnhofplatz/HB \n\nab Zürich, Bahnhofplatz/HB  (Fussweg)\nan Zürich HB \n\nab 19:37 Zürich HB - Gleis 7 (IC 587)\nan 20:41 Landquart - Gleis 2ABC\n\nab Landquart  (Fussweg)\nan Landquart, Bahnhof \n\nab 20:45 Landquart, Bahnhof  (BUS 3571)\nan 20:58 Trimmis, Churweg \n-\nDauer 1:40, Umsteigevorgänge 3\n\n\nFahrplan:\nhttp://fahrplan.sbb.ch/bin/query.exe/dn?S=Z%FCrich,%20Kalkbreite&Z=Trimmis,%20Churweg&date=08.02.13&time=19%3A18&\n \nÄnderungen vorbehalten. Alle Angaben, Anschlüsse und Einhaltung des Fahrplans ohne Gewähr.\nhttp://www.sbb.ch 
END:VEVENT
END:VCALENDAR

And then the output from gcalcli:

[beni@lilobster:~]$ gcalcli import -v Downloads/SBBVerbindung\ \(9\).ics
Event........Zürich
Start........2013-02-08 19:18:00+01:00
End..........2013-02-08 20:58:00+01:00
Local Start..2013-02-08 19:18:00+01:00
Local End....2013-02-08 20:58:00+01:00
Description:
Reise: Zürich

[S]kip [i]mport [q]uit: q

As you can see, the "Event" is only "Zürich" but really should be "Zürich, Kalkbreite -> Trimmis, Churweg", and Description is only "Reise: Zürich" without the following stuff.

I'm using gcalcli master, rev 8262bf9.

Regards
Benedikt

@tresni
Copy link
Collaborator

tresni commented Feb 9, 2013

Updated my comment below, it has more information now and links. Apparently editing a comment does not use Markdown...

@bekoeppel
Copy link
Author

Ah! Thanks, that explains it. I've contacted SBB.ch (the guys from whom I get those SBBVerbindung.ics file and asked them to correct their format.

@tresni
Copy link
Collaborator

tresni commented Feb 11, 2013

This is due to how vobject parses the file and not gcalcli itself. vobject uses a very strict interpretation of the iCalendar standard. The standard says a comma in a TEXT value (such as DESCRIPTION or SUMMARY) must be escaped since the comma has special meaning in the iCalendar format. Some libraries, such as icalendar, treat commas in single value fields as just a normal comma since the field can not or should not contain multiple values. This is not, to my understanding, inline with standard, but more of a way of accommodating (somewhat) common implementations of the standard.

A number of services send ICS files that are "broken" in this respect. WebEx is my personal pain point.

That said. I am working on a branch that uses icalendar instead of vobject.

Note: Edited to include a lot more information and links in case someone thinks I'm up the wrong tree

@tresni tresni closed this as completed Feb 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants