diff --git a/examples/command/command.cpp b/examples/command/command.cpp index 49f40342..49f8f755 100644 --- a/examples/command/command.cpp +++ b/examples/command/command.cpp @@ -23,6 +23,11 @@ #include #include +#if defined(_WIN32) +#define NOMINMAX +#include +#endif + // command-line parameters struct whisper_params { int32_t n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()); @@ -680,6 +685,10 @@ static int process_general_transcription(struct whisper_context * ctx, audio_asy } int main(int argc, char ** argv) { +#if defined(_WIN32) + SetConsoleOutputCP(CP_UTF8); +#endif + whisper_params params; if (whisper_params_parse(argc, argv, params) == false) { diff --git a/examples/stream/stream.cpp b/examples/stream/stream.cpp index 5f7387f7..bd7e05c1 100644 --- a/examples/stream/stream.cpp +++ b/examples/stream/stream.cpp @@ -14,6 +14,11 @@ #include #include +#if defined(_WIN32) +#define NOMINMAX +#include +#endif + // command-line parameters struct whisper_params { int32_t n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()); @@ -113,6 +118,10 @@ void whisper_print_usage(int /*argc*/, char ** argv, const whisper_params & para } int main(int argc, char ** argv) { +#if defined(_WIN32) + SetConsoleOutputCP(CP_UTF8); +#endif + whisper_params params; if (whisper_params_parse(argc, argv, params) == false) { diff --git a/examples/talk-llama/talk-llama.cpp b/examples/talk-llama/talk-llama.cpp index 51658700..d40667bb 100644 --- a/examples/talk-llama/talk-llama.cpp +++ b/examples/talk-llama/talk-llama.cpp @@ -17,6 +17,11 @@ #include #include +#if defined(_WIN32) +#define NOMINMAX +#include +#endif + static std::vector llama_tokenize(struct llama_context * ctx, const std::string & text, bool add_bos) { const llama_model * model = llama_get_model(ctx); const llama_vocab * vocab = llama_model_get_vocab(model); @@ -273,6 +278,10 @@ The transcript only includes text, it does not include markup like HTML and Mark {0}{4})"; int main(int argc, char ** argv) { +#if defined(_WIN32) + SetConsoleOutputCP(CP_UTF8); +#endif + whisper_params params; if (whisper_params_parse(argc, argv, params) == false) {