Revert "fix encoding"

This reverts commit 3a042c67f3.
This commit is contained in:
alejandro-campos 2020-06-26 13:47:39 +02:00
parent 3a042c67f3
commit 50ed6718d8
1 changed files with 6 additions and 11 deletions

View File

@ -378,20 +378,15 @@ our $THRRUN :shared = 1;
sub read_file($$) {
my ($path, $enc) = @_;
my $_FILE;
if ( $enc eq '' ) {
if( !open($_FILE, "<", $path) ) {
# failed to open, return undef
return undef;
}
} else {
if( !open($_FILE, "<:encoding($enc)", $path) ) {
# failed to open, return undef
return undef;
}
$enc = 'utf8';
}
my $_FILE;
if( !open($_FILE, "<:encoding($enc)", $path) ) {
# failed to open, return undef
return undef;
}
# Slurp configuration file content.
my $content = do { local $/; <$_FILE> };