]> git.refcnt.org Git - lugs.git/commitdiff
make-ical: adapt to encoding fix master
authorSteven Schubiger <stsc@refcnt.org>
Wed, 9 Jun 2021 20:24:47 +0000 (22:24 +0200)
committerSteven Schubiger <stsc@refcnt.org>
Wed, 9 Jun 2021 20:24:47 +0000 (22:24 +0200)
lreminder/reminder.pl
make-ical/make-ical.pl
make-rss/make-rss.pl

index 3326424fb9fe427679621e83264dc2b3982b3580..14ea60e811fdebc93890d44a919fbf7bff338303 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-
+#
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
@@ -15,7 +15,7 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 # Author: Steven Schubiger <stsc@refcnt.org>
-# Last modified: Thu Feb  4 23:21:02 CET 2016
+# Last modified: Wed 09 Jun 2021 01:19:17 PM CEST
 
 use strict;
 use warnings;
@@ -25,7 +25,7 @@ use constant false => 0;
 
 use DateTime ();
 use DBI ();
-use Encode qw(encode);
+use Encode qw(decode encode);
 use File::Basename ();
 use File::Spec ();
 use FindBin qw($Bin);
@@ -37,7 +37,7 @@ use Text::Wrap::Smart::XS qw(fuzzy_wrap);
 use URI ();
 use WWW::Mechanize ();
 
-my $VERSION = '0.52';
+my $VERSION = '0.53';
 
 #-----------------------
 # Start of configuration
@@ -240,11 +240,13 @@ ${\info_string()}
 MSG
 
     if ($run) {
+       $title = decode('UTF-8', $title);
         sendmail(
-            From    => $Config->{mail_from},
-            To      => $mail_subscriber,
-            Subject => encode('MIME-Q', "LUGS Reminder - $title"),
-            Message => $message,
+            From          => $Config->{mail_from},
+            To            => $mail_subscriber,
+            Subject       => encode('MIME-Q', "LUGS Reminder - $title"),
+            Message       => $message,
+           'Content-Type' => 'text/plain; charset="UTF-8"',
         ) or die "Cannot send mail: $Mail::Sendmail::error";
     }
     elsif ($test) {
index 8d6855ed49b84106fffa3ebdcb69c18836ee026d..e3a338f6dea9443fedeaae9c662f9f15286dc9a5 100755 (executable)
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 # Author: Steven Schubiger <stsc@refcnt.org>
-# Last modified: Wed Dec 27 21:42:20 CET 2017
+# Last modified: Wed 09 Jun 2021 10:05:08 PM CEST
 
 use strict;
 use warnings;
 use lib qw(lib);
 
-my $VERSION = '0.05';
+my $VERSION = '0.06';
 
 my $Config = {
     base_url => 'https://www.lugs.ch/lugs/termine',
@@ -46,9 +46,7 @@ use Data::ICal ();
 use Data::ICal::Entry::Event ();
 use Date::ICal ();
 use DateTime ();
-use Encode qw(encode);
 use File::Spec ();
-use HTML::Entities qw(decode_entities);
 use LUGS::Events::Parser ();
 
 sub new
@@ -107,9 +105,6 @@ sub process_events
         $location =~ s/\(.+?\)//g;
         $more =~ s/<.+?>//g if defined $more;
 
-        sub { decode_entities($_) foreach @_      }->($location, $summary, defined $more ? $more : ());
-        sub { $_ = encode('UTF-8', $_) foreach @_ }->($location, $summary, defined $more ? $more : ());
-
         my $get_offset = sub
         {
             my ($hour, $minute) = @_;
index 9505dad8fcc6fe9959814379fb8eee403d76a39e..3f34721d9dffdc489ab56e07eaf1e690eab24cf7 100755 (executable)
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 # Author: Steven Schubiger <stsc@refcnt.org>
-# Last modified: Wed Jul 24 14:45:23 CEST 2013
+# Last modified: Thu Dec 28 18:18:44 CET 2017
 
 use strict;
 use warnings;
 use lib qw(lib);
 
-my $VERSION = '0.01';
+my $VERSION = '0.02';
 
 my $Config = {
-    base_url  => 'http://www.lugs.ch/lugs/termine/',
+    base_url  => 'https://www.lugs.ch/lugs/termine/',
     language  => 'de',
     input     => './termine.txt',
     output    => './termine.rss',