Skip to content

Conversation

kuguma
Copy link

@kuguma kuguma commented Oct 16, 2025

Summary

Fixed the behavior of the llama.cpp general argument parser when given non-ASCII paths.

On Windows, argv strings are received in the system’s ANSI code page (ACP), so conversion to UTF-8 is required.

Comparison of behavior

Windows 11 Pro 24H2

PS > Get-WinSystemLocale
LCID             Name             DisplayName
----             ----             -----------
1041             ja-JP            Japanese (Japan)
PS > [Console]::InputEncoding.EncodingName
Japanese (Shift-JIS)
PS > [Console]::OutputEncoding.EncodingName
Unicode (UTF-8)

b6756

PS > llama-cli.exe -m "..\モデル\gemma-3-4b-it-Q4_K_M.gguf"
build: 6756 (bc07349a7) with MSVC 19.44.35214.0 for x64
main: llama backend init
main: load the model and apply lora adapter, if any
gguf_init_from_file: failed to open GGUF file '..\���f��\gemma-3-4b-it-Q4_K_M.gguf'
llama_model_load: error loading model: llama_model_loader: failed to load model from ..\���f��\gemma-3-4b-it-Q4_K_M.gguf
llama_model_load_from_file_impl: failed to load model
common_init_from_params: failed to load model '..\���f��\gemma-3-4b-it-Q4_K_M.gguf', try reducing --n-gpu-layers if you're running out of VRAM
main: error: unable to load model

This PR

PS > llama-cli.exe -m "..\モデル\gemma-3-4b-it-Q4_K_M.gguf"
build: 6758 (7ae5e44d4) with MSVC 19.44.35214.0 for x64
main: llama backend init
main: load the model and apply lora adapter, if any
llama_model_loader: loaded meta data with 40 key-value pairs and 444 tensors from ..\モデル\gemma-3-4b-it-Q4_K_M.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
~~~
> 

Note

This PR is related to

Reproducing the issue with non-ASCII .mmproj paths in existing CLI tools requires first applying the changes from this PR. (This doesn’t apply when the tools are called internally.)

@kuguma kuguma requested a review from ggerganov as a code owner October 16, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant