From e647ba15448ea6e077bd0f6257cbd2205571a7b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Tue, 23 Jun 2009 14:34:52 +0000 Subject: [PATCH] * QP encode ical text fields; work on bug 351 --- webcit/event.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/webcit/event.c b/webcit/event.c index 26dd217bd..ea4e84851 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -811,7 +811,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr if ( (havebstr("save_button")) || (havebstr("check_button")) ) { - + StrBuf *Buf = NewStrBuf(); /* Replace values in the component with ones from the form */ while (prop = icalcomponent_get_first_property(vevent, @@ -821,11 +821,20 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr } if (havebstr("summary")) { - icalcomponent_add_property(vevent, - icalproperty_new_summary(bstr("summary"))); + FlushStrBuf(Buf); + StrBufRFC2047encode(&Buf, sbstr("summary")); + icalcomponent_add_property( + vevent, + icalproperty_new_summary(ChrPtr(Buf))); } else { - icalcomponent_add_property(vevent, - icalproperty_new_summary(_("Untitled Event"))); + StrBuf *Untitled; + FlushStrBuf(Buf); + Untitled = NewStrBufPlain(_("Untitled Event"), -1); + StrBufRFC2047encode(&Buf, Untitled); + FreeStrBuf(&Untitled); + icalcomponent_add_property( + vevent, + icalproperty_new_summary(ChrPtr(Buf))); } while (prop = icalcomponent_get_first_property(vevent, @@ -834,8 +843,11 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr icalproperty_free(prop); } if (havebstr("location")) { - icalcomponent_add_property(vevent, - icalproperty_new_location(bstr("location"))); + FlushStrBuf(Buf); + StrBufRFC2047encode(&Buf, sbstr("location")); + icalcomponent_add_property( + vevent, + icalproperty_new_location(ChrPtr(Buf))); } while (prop = icalcomponent_get_first_property(vevent, ICAL_DESCRIPTION_PROPERTY), prop != NULL) { @@ -843,8 +855,11 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr icalproperty_free(prop); } if (havebstr("description")) { - icalcomponent_add_property(vevent, - icalproperty_new_description(bstr("description"))); + FlushStrBuf(Buf); + StrBufRFC2047encode(&Buf, sbstr("description")); + icalcomponent_add_property( + vevent, + icalproperty_new_description(ChrPtr(Buf))); } while (prop = icalcomponent_get_first_property(vevent, @@ -1155,7 +1170,7 @@ STARTOVER: for (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDE icalcomponent_free(encaps); encaps = NULL; } - + FreeStrBuf(&Buf); } /* -- 2.30.2