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} %