[Freeassociation-devel] libical: TZID prefix
Allen Winter
winter at kde.org
Thu Aug 11 04:41:55 PDT 2011
On Thursday 11 August 2011 5:52:27 AM Patrick Ohly wrote:
> Hello Allen!
>
> I'm having some issue with the libical compiled from source which might
> be related to your following commit:
>
> commit 58333eb3d2a2001fd9f696bcb63e54ff604915c6
> Author: awinterz <awinterz at b29e25b1-4845-0410-9c6e-9608a45a5811>
> Date: Sat Mar 19 20:51:06 2011 +0000
>
> don't put the tzid_prefixTzfile in the tzid
>
> git-svn-id:
> https://freeassociation.svn.sourceforge.net/svnroot/freeassociation/trunk@1066 b29e25b1-4845-0410-9c6e-9608a45a5811
>
> What was the rationale for no longer putting the prefix into the TZID?
>
I think I removed it because I didn't understand why it was there and
it was causing a failure in the regression tests.
I'll revert then.
> The problem is that the following program fails because
> icaltimezone_get_builtin_timezone_from_tzid() fails to resolve the
> "Europe/Berlin" TZID:
>
> ----------------------------------
> #include <libical/ical.h>
> #include <stdio.h>
> #include <string>
>
> int main(int argc, char **argv)
> {
> icaltimezone *tzdef = icaltimezone_get_builtin_timezone("Europe/Berlin");
> if (tzdef) {
> std::string tzid = icaltimezone_get_tzid(tzdef);
> printf("Europe/Berlin = TZID %s\n", tzid.c_str());
> tzdef = icaltimezone_get_builtin_timezone_from_tzid(tzid.c_str());
> printf("lookup by TZID %s\n", tzdef ? "okay" : "failed");
> }
> return 0;
> }
> ----------------------------------
>
> The easiest fix is to revert your commit above, but if the change is
> important, a different solution needs to be found.
>
> A quick check shows that the lookup fails because it expects the TZID to
> have the prefix:
>
> /* Check that the TZID starts with our unique prefix. */
> if (strncmp (tzid, ical_tzid_prefix, strlen(ical_tzid_prefix)))
> return NULL;
>
> That would have to be removed. But I'm a bit wary of other implications
> of removing the TZID prefix and haven't tried that. SyncEvolution and
> libsynthesis have not been tested with libical time zones without any
> kind of prefix.
>
>
--
Allen Winter | allen at kdab.net | Software Engineer
KDAB (USA), LLC, a KDAB Group company
Tel. USA +1-866-777-KDAB(5322), Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
More information about the libical-devel
mailing list