From d70b43aa614995740f4ddfb6dfc00374fe6adcef Mon Sep 17 00:00:00 2001 From: Hironobu Yamashita Date: Sat, 21 Mar 2020 01:28:40 +0000 Subject: haranoaji-tlpost.pl: update from M. Hosoda git-svn-id: svn://tug.org/texlive/trunk@54445 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/tlpostcode/haranoaji-tlpost.pl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'Master/tlpkg/tlpostcode') diff --git a/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl b/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl index 07cab2eed4e..90320bec1ee 100644 --- a/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl +++ b/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl @@ -38,14 +38,17 @@ use feature 'state'; use Encode; if (win32 ()) { + # These packages are not necessarily available on non-Windows, so + # read them at runtime instead of compile time. + require Encode::Locale; + Encode::Locale->import (); + + # ':encoding(console_{in|out})' requires Encode::Locale package. binmode (STDIN, ':encoding(console_in)'); binmode (STDOUT, ':encoding(console_out)'); binmode (STDERR, ':encoding(console_out)'); print "haranoaji-tlpost\n"; - - # These packages are not necessarily available on non-Windows, so - # read them at runtime instead of compile time. - require Encode::Locale; + require Win32::API; Win32::API->import (); } else { @@ -323,7 +326,7 @@ sub create_file_with_contents { my ($filename, $contents) = @_; # TODO: Create file by -W API on Windows - open (my $fh, ">:raw", encode ('locale', $filename)) or + open (my $fh, ">:raw", encode ('locale_fs', $filename)) or die ("Open failed: ${filename}\n"); print $fh $contents; close $fh; @@ -334,7 +337,7 @@ sub wrapper_isdir { my ($dirname) = @_; # TODO: Directory existence check by -W API on Windows - if ( -d encode ('locale', $dirname) ) { + if ( -d encode ('locale_fs', $dirname) ) { return 1; } @@ -346,7 +349,7 @@ sub wrapper_isfile { my ($filename) = @_; # TODO: File existence check by -W API on Windows - if ( -f encode ('locale', $filename) ) { + if ( -f encode ('locale_fs', $filename) ) { return 1; } @@ -358,7 +361,7 @@ sub wrapper_unlink { my ($filename) = @_; # TODO: Remove file by -W API on Windows - return unlink (encode ('locale', $filename)); + return unlink (encode ('locale_fs', $filename)); } # Create symbolic link -- cgit v1.2.3