Merge remote-tracking branch 'stevee/proxy-squidclamav' into next

Conflicts:
	config/cfgroot/general-functions.pl
This commit is contained in:
Arne Fitzenreiter
2013-07-15 20:49:23 +02:00
6 changed files with 87 additions and 12 deletions

View File

@@ -1030,4 +1030,27 @@ sub RedIsWireless() {
return 0;
}
# Function to read a file with UTF-8 charset.
sub read_file_utf8 ($) {
my ($file) = @_;
open my $in, '<:encoding(UTF-8)', $file or die "Could not open '$file' for reading $!";
local $/ = undef;
my $all = <$in>;
close $in;
return $all;
}
# Function to write a file with UTF-8 charset.
sub write_file_utf8 ($) {
my ($file, $content) = @_;
open my $out, '>:encoding(UTF-8)', $file or die "Could not open '$file' for writing $!";;
print $out $content;
close $out;
return;
}
1;