select utf8 codepage on windows

This commit is contained in:
Judd 2025-02-19 16:40:51 +08:00
parent b3a6018bbf
commit 00ddb10fe2
3 changed files with 27 additions and 0 deletions

View File

@ -23,6 +23,11 @@
#include <map>
#include <chrono>
#if defined(_WIN32)
#define NOMINMAX
#include <windows.h>
#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) {

View File

@ -14,6 +14,11 @@
#include <fstream>
#include <chrono>
#if defined(_WIN32)
#define NOMINMAX
#include <windows.h>
#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) {

View File

@ -17,6 +17,11 @@
#include <sstream>
#include <chrono>
#if defined(_WIN32)
#define NOMINMAX
#include <windows.h>
#endif
static std::vector<llama_token> 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) {