From e436db25ff444c0ea4eb5b60c402f3d6dca58c4e Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Thu, 2 Jul 2026 16:59:23 -0700 Subject: [PATCH] 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 --- llama/compat/llama-ollama-compat-util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama/compat/llama-ollama-compat-util.cpp b/llama/compat/llama-ollama-compat-util.cpp index d09d6fde9..7520608aa 100644 --- a/llama/compat/llama-ollama-compat-util.cpp +++ b/llama/compat/llama-ollama-compat-util.cpp @@ -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));