UTF-16 .ics files break the event importer dialog (UTF-8 and ISO-8859-15 work) and have offset times (due to events referencing custom virtual timezones)
Context
Looking at @kuhl's issue #1242 (closed), we can see that .ics files can define 100% custom fake timezones, like "The time of the university campus", and reference that in their events.
This becomes clear with the attached file: issue_1242_-_simplified.ics
…which is my simplified version of the sample found in #1242 (closed) (which was a file generated by Datenlotsen Gmbh's "CampusNet" platform), and much easier to understand than what is seen in #1110.
Click to expand: file contents
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Datenlotsen Informationssysteme GmbH//CampusNet//DE
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:CampusNetZeit
BEGIN:STANDARD
DTSTART:16011028T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010325T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=CampusNetZeit:20240603T101500
DTEND;TZID=CampusNetZeit:20240603T114500
LOCATION:somewhere
SEQUENCE:0
UID:389584207457478
DTSTAMP:20240608T184316Z
SUMMARY:Freiraum und Landschaft
CATEGORIES:
END:VEVENT
END:VCALENDAR
(A notable difference from issue #1110 is also that the virtual timezone actually exists in this file, whereas the sample provided in 1110 was referencing a virtual timezone that was not even defined in the file. Still, Milan's advice in #1110 (comment 2046441) is probably relevant here too?)
How this manifests as a bug in GNOME Calendar
Evolution's .ics import dialog can handle this situation fine, but GNOME Calendar's .ics event importer dialog completely breaks (due to the UTF-16
encoding; see further below): it does not show a preview of the event, and clicking the blue "Import" button does nothing.
|
|
---|---|
In terms of time mapping, how are we supposed to handle that in GNOME Calendar? Evolution does, but... it shows "CampusNetZeit" as a custom timezone in the timezone's GtkEntry widget shown below (so this might need design feedback from @bertob @PhilippSauberz @snwh, as it might influence issue #2 too):
The specific case of file encoding
The sample file above breaks the import dialog in GNOME Calendar only if it remains encoded in UTF-16.
Line break styles don't change anything, but if I tell gedit to save that file as either UTF-8
or ISO-8859-15
instead of UTF-16
, then the import dialog is able to read it, although the times do not match Evolution's interpretation, there is an offset:
If I save back into UTF-16
, it breaks the importer dialog again.
See also: https://en.wikipedia.org/wiki/Comparison_of_Unicode_encodings
Therefore, there are two issues:
- Here (issue 1243) is the encoding parsing bug
- #1242 (closed) is the virtual event timezone offset bug