Joerg Johannes wrote:
Hi again
this script is exactly what I wanted. Only one problem: It freezes on dates containing non-ASCII characters, especially "Ã". Any idea how I could solve this?
Apparently this is not a problem with the script, but with the file encoding. The console freezes on this character even when I just do a "cat calendar.ics".
I guess so and I don't know what to do about that.
This was a quick solution to a problem. These lines would have to be smarter:When I looked at the "Ã" in your email especially in the new small font that Mozilla-Thunderbird is now using it looked like "g".
my $day = substr( $xx, 6, 2 );
my $hour = substr( $xx, 9, 2 );
If I knew exactly where the "g"s were happening I could fix it. It also might a good exersize for you. :)
What "g"s?
Exactly. So you still need:I'm 7 hours away from you and I wanted local time. Change the following line:Furthermore, .ics from evolution is not equal to .ics from korganizer. If I use the evolution Calendar.ics file, all dates are timed 5 pm - 5 pm, while after importing them to korganizer/export them as .ics again, it works (apart from the "Ã" problem). Strange.
my $zone = 7;
to reflect your time zone and you will have local time also.
This is not even necessary, as the time is stored in local time from
evolution.
my $zone = 0;
for local time. My system runs on UT and displays local time on the desktop as I guess many machines do.
The script I sent you wouldn't have even matched the DTSTART's and DTEND's for evolution since it was looking for a ":" immediately after DTSTART or DTEND. Use the following lines instead:The problem is: the DTSTART and DTEND lines contain information about the timezone in the evolution, but not in the korganizer file version:
Evolution: DTSTART;TZID=/softwarestudio.org/Olson_20011030_5/Europe/Berlin: 20040516T143000
korganizer: DTSTART:20040516T143000Z
if( /DTSTART.*:(.*)/ ) { $event[$eventNumber]{start} = $1; next; }
if( /DTEND.*:(.*)/ ) { $event[$eventNumber]{end} = $1; next; }The ".*" after DTSTART and DTEND will match zero or more characters between DTSTART or DTEND and the ":" preceding the date and time and will therefore skip the time zone information when present for evolution. I just tested them here and they work fine for korganizer.
Therefore the pattern matching in your script does not work on the evolution file: It must not match the string after "DTSTART", but the string on the line after the line beginning with "DTSTART" (and now tell me how to express that in perl... ;) ).
Right. See above.
Have fun,
Paul
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

