[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] List of dates from evolutions calendar

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:
  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?

When I looked at the "ß" in your email especially in the new small font that Mozilla-Thunderbird is now using it looked like "g".

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.

I'm 7 hours away from you and I wanted local time. Change the following line:

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
Exactly.  So you still need:
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 problem is: the DTSTART and DTEND lines contain
information about the timezone in the evolution, but not in the
korganizer file version:



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:
     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,


Reply to: