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

This PR should fix #912
This commit is contained in:
The0Dev
2025-12-27 18:50:17 +03:00
committed by GitHub
parent 257c449a6a
commit f81db4e692

View File

@@ -16,7 +16,7 @@
#include <string>
#include <vector>
// [CLI11:public_includes:end]
#include "Encoding.hpp"
#include "Error.hpp"
#include "StringTools.hpp"
@@ -70,7 +70,12 @@ class Config {
/// Parse a config file, throw an error (ParseError:ConfigParseError or FileError) on failure
CLI11_NODISCARD std::vector<ConfigItem> from_file(const std::string &name) const {
#if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0
std::ifstream input{to_path(name)};
#else
std::ifstream input{name};
#endif
if(!input.good())
throw FileError::Missing(name);