Closed Bug 264447 Opened 20 years ago Closed 20 years ago

Export into vCalendar format has illegal newlines

Categories

(Calendar :: Sunbird Only, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gekacheka, Assigned: mostafah)

References

Details

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; rv:1.7.3) Gecko/20040913 Firefox/0.10.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a4) Gecko/20041001 Mozilla Sunbird/0.2a

As reported https://bugzilla.mozilla.org/show_bug.cgi?id=231724#c9.
Gives problems for devices which can only import vCalendar 1.0 files.

Problem is iCalendar (v2.0) [rfc2445sec4.1] says lines can be broken anywhere
to comply with 75-octet line length, but vCalendar (v1.0) [vCalendar1.0sec
2.1.3] says lines can only be broken at places where there may be linear white
space.

Another difference is long text values:  iCalendar uses \n to encode newlines in
text values, vcalendar requires quoted-printable =0D=0A or base64 encoding.

Reproducible: Always
Steps to Reproduce:
1. Select events to export
2. control-O (Export Selected Events)
3. Select type vCalendar files (last type)
4. Save

Actual Results:  
BEGIN:VCALENDAR
VERSION
 :2.0
PRODID
 :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
METHOD
 :PUBLISH
BEGIN:VEVENT
UID
 :7fc113ee-1dce-11d9-96e9-aca8b7518fea
SUMMARY
 :DummyTitle
LOCATION
 :DummyLocation
STATUS
 :TENTATIVE
...

Expected Results:  
BEGIN:VCALENDAR
VERSION:1.0
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
METHOD:PUBLISH
BEGIN:VEVENT
UID:7fc113ee-1dce-11d9-96e9-aca8b7518fea
SUMMARY:DummyTitle
LOCATION:DummyLocation
STATUS:TENTATIVE
...
saveEventsToFile:  call patchICalStringForVCal if vcalendar is selected.

patchICalStringForVCal: new, 
    - converts iCal to vCal newlines 
       * None before ':'.
       * if needed for \n in value, add ENCODING=QUOTED-PRINTABLE, use =0D=0A
       * rebreak continuation lines.
    - replace \, with , in summary, description, etc. text values
    - version:2.0 becomes version:1.0.
    
  breakIntoContinuationLines: used by patchICalStringForVCal
  endsWith: used by patchICalStringForVCal
Attached file Input test file with events —
Blocks: 231724
Attachment #162149 - Flags: first-review?(mostafah)
Comment on attachment 162149 [details] [diff] [review]
importExport.js patch: convert iCal to vCal newlines

Checked in. Thanks
Attachment #162149 - Flags: first-review?(mostafah) → first-review+
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
The bugspam monkeys have been set free and are feeding on Calendar :: Sunbird Only. Be afraid for your sanity!
QA Contact: gurganbl → sunbird
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: