fix: handle UTF-8 file paths on Windows (#2145)

This commit is contained in:
therealshulgin authored and GitHub committed 2026-10-17 00:50:42 +08:00
1 parent 8c442fb0ad
commit 2f016e8e30
9 files changed
+100 -82

No files matched your search

+2 -1
View File
@@ -4,6 +4,7 @@
#include <cctype>
#include <cstdint>
#include <cstring>
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <iostream>
@@ -276,7 +277,7 @@ namespace {
}
bool read_file(const std::string& path, std::vector<uint8_t>& data, std::string& error) {
std::ifstream fin(path, std::ios::binary);
std::ifstream fin(std::filesystem::u8path(path), std::ios::binary);
if (!fin) {
error = "failed to open file: " + path;
return false;