From: b Date: Sun, 18 Jun 2023 07:31:28 +0000 (+0000) Subject: fixed encoding option of file opening X-Git-Tag: v1.0.12 X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=refs%2Ftags%2Fv1.0.12;p=botm%2Fcommon-perl fixed encoding option of file opening --- diff --git a/botm_common.pm b/botm_common.pm index 0e8c405..0277cab 100644 --- a/botm_common.pm +++ b/botm_common.pm @@ -25,7 +25,7 @@ use Encode ('encode', 'decode'); use Exporter; -our $VERSION = '1.0.11'; +our $VERSION = '1.0.12'; our @ISA = qw(Exporter); our @EXPORT = (); our @EXPORT_OK = ( @@ -193,7 +193,7 @@ sub read_data_file { } } else { - unless (open ($fh, "<:$encoding", encode('locale_fs', $file))) { + unless (open ($fh, "<:encoding($encoding)", encode('locale_fs', $file))) { return %data; } } @@ -282,7 +282,7 @@ sub write_data_file { } } else { - unless (open ($fh, ">:$encoding", encode('locale_fs', $file))) { + unless (open ($fh, ">:encoding($encoding)", encode('locale_fs', $file))) { return 0; } }