Skip to content

mtmd : Fix/Add non-ASCII file path support on Windows - #16609

Closed
kuguma wants to merge 2 commits into
ggml-org:masterfrom
ailia-ai:fix-mtmd-filepath-encoding
Closed

kuguma wants to merge 2 commits into
ggml-org:masterfrom
ailia-ai:fix-mtmd-filepath-encoding

Conversation

@kuguma

@kuguma kuguma commented Oct 16, 2025 •

Copy link
Copy Markdown

Summary

Fixed path handling in the mtmd feature on Windows to correctly convert and process non-ASCII file paths.

Additionally, fixed a missing console initialization in mtmd-cli.

Issues Resolved

  • Failed to load .mmproj files with non-ASCII file paths

  • Failed to load image files with non-ASCII file paths

  • Incorrect path parsing in mtmd-cli when using /image <filepath> with non-ASCII characters

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-mtmd-cli.exe -m ... --mmproj ...
~~~
> /image テスト画像.jpg
Unable to open file ツテツスツトツ嘉ヲツ堕・jpg: Illegal byte sequence

This PR

PS > llama-mtmd-cli.exe -m ... --mmproj ...
~~~
> /image テスト画像.jpg
テスト画像.jpg image loaded

Notes

The general argument-handling logic in llama.cpp also has issues with non-ASCII paths.
Since the impact area is broad, I will submit a separate PR to address this.

@kuguma kuguma changed the title Add non-ASCII file path support to the mtmd feature on Windows mtmd : Fix/Add non-ASCII file path support on Windows Oct 16, 2025
@kuguma

kuguma commented Oct 16, 2025

Copy link
Copy Markdown
Author

Fixed an unintended change in the PR.

Comment thread tools/mtmd/mtmd-helper.cpp Outdated
@kuguma

kuguma commented Nov 7, 2025

Copy link
Copy Markdown
Author

Hello, are there any remaining tasks to be done with the merge? Is there anything I can help with?

@kuguma
kuguma force-pushed the fix-mtmd-filepath-encoding branch from a2bc45b to cb9588a Compare January 16, 2026 08:31
@ngxson

ngxson commented Jun 18, 2026 •

Copy link
Copy Markdown
Collaborator

superseded by #24779

@ngxson ngxson closed this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants