This commit is contained in:
ipcjs 2026-04-23 20:17:01 +08:00 committed by GitHub
commit 5553600ea5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 3 deletions

View File

@ -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)

View File

@ -929,9 +929,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

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- https://stackoverflow.com/questions/79668459/c-argv-with-utf-8-values-are-incorrect-in-the-program -->
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity type="win32" name="whisper-cli" version="1.0.0.0"/>
<application>
<windowsSettings>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
</windowsSettings>
</application>
</assembly>