diff --git a/examples/cli/CMakeLists.txt b/examples/cli/CMakeLists.txt index 3a73776c5..812955300 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/cli.cpp b/examples/cli/cli.cpp index c64976a56..4a82c28a3 100644 --- a/examples/cli/cli.cpp +++ b/examples/cli/cli.cpp @@ -971,9 +971,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 diff --git a/examples/cli/win32.manifest b/examples/cli/win32.manifest new file mode 100644 index 000000000..f425b72fb --- /dev/null +++ b/examples/cli/win32.manifest @@ -0,0 +1,10 @@ + + + + + + + UTF-8 + + +