diff options
author | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2020-03-21 01:28:40 +0000 |
---|---|---|
committer | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2020-03-21 01:28:40 +0000 |
commit | d70b43aa614995740f4ddfb6dfc00374fe6adcef (patch) | |
tree | eec29e708fffc073df19ee5973c3326ae3f3d266 /Master/tlpkg/tlpostcode | |
parent | 9dc2fad49b615762fd4fa45b90b2c3d869589351 (diff) |
haranoaji-tlpost.pl: update from M. Hosoda
git-svn-id: svn://tug.org/texlive/trunk@54445 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlpostcode')
-rw-r--r-- | Master/tlpkg/tlpostcode/haranoaji-tlpost.pl | 19 |
1 files changed, 11 insertions, 8 deletions
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 |