compat: use UTF-8-safe file open (#16999)

Use ggml_fopen for compat tensor reads so Windows paths with Unicode characters are converted through the same UTF-8-to-wide path as llama.cpp model loading.

Fixes #16493
This commit is contained in:
Daniel Hiltgen 2026-07-02 16:59:23 -07:00 committed by GitHub
parent 26acfa42b5
commit e436db25ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -275,7 +275,7 @@ bool take_load_op(const char * dest_name, LoadOp & out) {
}
bool read_at(const char * path, size_t offset, void * dst, size_t size) {
FILE * f = std::fopen(path, "rb");
FILE * f = ggml_fopen(path, "rb");
if (!f) {
std::fprintf(stderr, "%s: open failed path=%s offset=%zu size=%zu errno=%d (%s)\n",
__func__, path, offset, size, errno, std::strerror(errno));