mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 03:24:30 +00:00
fix: handle UTF-8 file paths on Windows (#2145)
This commit is contained in:
1 parent
8c442fb0ad
commit
2f016e8e30
9 files changed
+100
-82
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user