From c3c7e3c428a7887371be3315c85bea13a5045a5a Mon Sep 17 00:00:00 2001 From: "ipcjs.395" Date: Sat, 17 Jan 2026 04:42:59 +0800 Subject: [PATCH 1/2] fix: Add win32 manifest file for UTF-8 support in whisper-cli --- examples/cli/CMakeLists.txt | 4 ++++ examples/cli/win32.manifest | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 examples/cli/win32.manifest diff --git a/examples/cli/CMakeLists.txt b/examples/cli/CMakeLists.txt index 3a73776c..81295530 100644 --- a/examples/cli/CMakeLists.txt +++ b/examples/cli/CMakeLists.txt @@ -5,4 +5,8 @@ include(DefaultTargetOptions) target_link_libraries(${TARGET} PRIVATE common whisper ${FFMPEG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) +if (WIN32) + target_sources(${TARGET} PRIVATE win32.manifest) +endif() + install(TARGETS ${TARGET} RUNTIME) diff --git a/examples/cli/win32.manifest b/examples/cli/win32.manifest new file mode 100644 index 00000000..f425b72f --- /dev/null +++ b/examples/cli/win32.manifest @@ -0,0 +1,10 @@ + + + + + + + UTF-8 + + + From 9093b664fd6c6f35c0f088a5d8057fe92f0c2f67 Mon Sep 17 00:00:00 2001 From: "ipcjs.395" Date: Sat, 17 Jan 2026 05:20:49 +0800 Subject: [PATCH 2/2] wip: update comment --- examples/cli/cli.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/cli/cli.cpp b/examples/cli/cli.cpp index 9a54742f..415edef9 100644 --- a/examples/cli/cli.cpp +++ b/examples/cli/cli.cpp @@ -922,9 +922,8 @@ int main(int argc, char ** argv) { ggml_backend_load_all(); #if defined(_WIN32) - // Set the console output code page to UTF-8, while command line arguments - // are still encoded in the system's code page. In this way, we can print - // non-ASCII characters to the console, and access files with non-ASCII paths. + // Set the console output code page to UTF-8. With the win32.manifest, + // command line arguments and file paths are also treated as UTF-8. SetConsoleOutputCP(CP_UTF8); #endif