Skip to content

Fix 'UTF-8 config filenames not supported on Windows' #912#1273

Merged
phlptp merged 2 commits into
CLIUtils:mainfrom
The0Dev:fix-utf8-config-912
Dec 27, 2025
Merged

Fix 'UTF-8 config filenames not supported on Windows' #912#1273
phlptp merged 2 commits into
CLIUtils:mainfrom
The0Dev:fix-utf8-config-912

Conversation

@The0Dev
Copy link
Copy Markdown
Contributor

@The0Dev The0Dev commented Dec 25, 2025

This PR should fix #912

@phlptp
Copy link
Copy Markdown
Collaborator

phlptp commented Dec 25, 2025

We are either going to have to put the change inside a conditional compilation block or define to_path as an empty operation for compilations without <filesystem>

@The0Dev
Copy link
Copy Markdown
Contributor Author

The0Dev commented Dec 25, 2025

I've added a conditional compilation block. I think the fix should cover many users. However, since the --config path is stored as a std::string, it must be encoded in UTF-8. I assume that, even on older C++ standards, the to_path function on Windows should convert from UTF-8 to the current locale or directly to UTF-16 (the overload for the std::ifstream constructor that takes a wide string is non-standard though.)

@phlptp
Copy link
Copy Markdown
Collaborator

phlptp commented Dec 26, 2025

@all-contributors add @The0Dev for code

@allcontributors
Copy link
Copy Markdown
Contributor

@phlptp

I've put up a pull request to add @The0Dev! 🎉

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e4ee3af) to head (2e1d09e).
⚠️ Report is 158 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##              main     #1273     +/-   ##
===========================================
  Coverage   100.00%   100.00%             
===========================================
  Files           17        19      +2     
  Lines         4546      5050    +504     
  Branches         0      1080   +1080     
===========================================
+ Hits          4546      5050    +504     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@phlptp phlptp merged commit f81db4e into CLIUtils:main Dec 27, 2025
95 of 97 checks passed
phlptp pushed a commit that referenced this pull request Dec 27, 2025
Adds @The0Dev as a contributor for code.

This was requested by phlptp [in this
comment](#1273 (comment))

[skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UTF8/Unicode config filename not supported on Windows

2 participants