[latex3-commits] [latex3/l3build] main: Support filenames falling in current codepage (Win) (see #122) (7412399)
github at latex-project.org
github at latex-project.org
Thu Oct 12 07:12:07 CEST 2023
Repository : https://github.com/latex3/l3build
On branch : main
Link : https://github.com/latex3/l3build/commit/7412399c4038d10514cb3847186fb979c198c283
>---------------------------------------------------------------
commit 7412399c4038d10514cb3847186fb979c198c283
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu Oct 12 06:12:07 2023 +0100
Support filenames falling in current codepage (Win) (see #122)
>---------------------------------------------------------------
7412399c4038d10514cb3847186fb979c198c283
CHANGELOG.md | 4 ++++
l3build-file-functions.lua | 8 +++++++-
l3build.dtx | 8 ++++++++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f0af1e3..232280b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Fixed
+- Support non-ASCII filenames that fall within the system codepage on Windows
+ (see \#122)
+
## [2023-09-13]
### Added
diff --git a/l3build-file-functions.lua b/l3build-file-functions.lua
index d6ec0cd..847a1d1 100644
--- a/l3build-file-functions.lua
+++ b/l3build-file-functions.lua
@@ -153,9 +153,15 @@ if os_type == "windows" then
os_yes = "for /l %I in (1,1,300) do @echo y"
end
+-- Deal with codepage hell on Windows
+local function fixname(f) return f end
+if chgstrcp then
+ fixname = chgstrcp.utf8tosyscp
+end
+
-- Deal with the fact that Windows and Unix use different path separators
local function unix_to_win(path)
- return gsub(path, "/", "\\")
+ return fixname(gsub(path, "/", "\\"))
end
function normalize_path(path)
diff --git a/l3build.dtx b/l3build.dtx
index b6787a1..242bec5 100644
--- a/l3build.dtx
+++ b/l3build.dtx
@@ -2141,6 +2141,14 @@
% Full descriptions of their usage and arguments can be found within the |l3build-manifest-setup.lua|
% code itself.
%
+% \section{Known limitations}
+%
+% \subsection{Non-\textsc{ascii} filenames}
+%
+% On Windows, support for non-\textsc{ascii} filenames is limited by the way
+% that Lua handles system calls. While calling \TeX{} engines should work with
+% any name, general file operations will only success if the filename falls
+% within the codepage currently in use by the operating system.
%
% \end{documentation}
%
More information about the latex3-commits
mailing list.