Skip to content

Commit

Permalink
Support filenames falling in current codepage (Win) (see #122)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Oct 12, 2023
1 parent 119618e commit 7412399
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion l3build-file-functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions l3build.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
%
Expand Down

0 comments on commit 7412399

Please sign in to comment.