summaryrefslogtreecommitdiff
path: root/lib/Tools.pm
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2008-08-10 14:05:26 +0000
committerAndreas Brachold <vdr07@deltab.de>2008-08-10 14:05:26 +0000
commit2e9c00e1bdd19f3fb61ce0aaede85d5f5400ef81 (patch)
treebf3734ba1dbfb0e8c5df072c55b19b62603135b5 /lib/Tools.pm
parent11ad754da4d127a74e26894e97c232a3a98972b5 (diff)
downloadxxv-2e9c00e1bdd19f3fb61ce0aaede85d5f5400ef81.tar.gz
xxv-2e9c00e1bdd19f3fb61ce0aaede85d5f5400ef81.tar.bz2
* AUTOTIMER: fix some orthography
* EVENTS: store news from last month into database * RSS: dump news from database * TIMERS: event if timer adjusted * TIMERS/AUTOTIMER: rewrite event/news handling * xxvd: show pid at startup * xxvd: show base revision at startup * CHANNELS: fix detect radio channels * REPORT: Refactoring event handling, move any function to modul EVENTS. * EVENTS: elist function to list news as table * EVENTS: respect minimum level to exclude unwanted harmless news * RSS/MAIL... : remove dependency to modul REPORT
Diffstat (limited to 'lib/Tools.pm')
-rw-r--r--lib/Tools.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Tools.pm b/lib/Tools.pm
index 682fdde..984314d 100644
--- a/lib/Tools.pm
+++ b/lib/Tools.pm
@@ -356,9 +356,9 @@ sub load_file {
lg sprintf('Load file "%s" (%s)',$file, $binmode);
my $mode = '<';
-# if($binmode ne 'binary') {
-# $mode .= ':utf8' if($CHARSET && $CHARSET eq 'UTF-8');
-# }
+ #if($binmode ne 'binary') {
+ # $mode .= ':encoding(utf8)' if($CHARSET && $CHARSET eq 'UTF-8');
+ #}
my $fh = IO::File->new($file,$mode)
or return error(sprintf("Couldn't open %s : %s!",$file,$!));
@@ -384,11 +384,12 @@ sub save_file {
if($binmode ne 'binary') {
$data =~ s/\r\n/\n/sig;
-# $mode .= ':utf8' if($CHARSET && $CHARSET eq 'UTF-8');
+ # $mode .= ':encoding(utf8)' if($CHARSET && $CHARSET eq 'UTF-8');
}
my $fh = IO::File->new($file,$mode)
- or return error(sprintf("Couldn't write %s : %s!",$file,$!));
+ or return error(sprintf("Couldn't write %s : %s!",$file,$!));
+
print $fh $data;
$fh->close;