From 0627b354c5cd5e940c566950f2951e3235eaae4c Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期一, 18 十二月 2023 09:55:03 +0800
Subject: [PATCH] SetConsoleOutputCP for win

---
 runtime/websocket/bin/funasr-wss-client-2pass.cpp |    3 ++-
 runtime/websocket/bin/funasr-wss-server.cpp       |    4 ++++
 runtime/websocket/bin/funasr-wss-client.cpp       |    1 +
 runtime/websocket/bin/funasr-wss-server-2pass.cpp |    4 ++++
 4 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/runtime/websocket/bin/funasr-wss-client-2pass.cpp b/runtime/websocket/bin/funasr-wss-client-2pass.cpp
index ec3da35..2db66ff 100644
--- a/runtime/websocket/bin/funasr-wss-client-2pass.cpp
+++ b/runtime/websocket/bin/funasr-wss-client-2pass.cpp
@@ -475,7 +475,8 @@
 
 int main(int argc, char* argv[]) {
 #ifdef _WIN32
-    SetConsoleOutputCP(65001);
+  #include <windows.h>
+  SetConsoleOutputCP(65001);
 #endif
   google::InitGoogleLogging(argv[0]);
   FLAGS_logtostderr = true;
diff --git a/runtime/websocket/bin/funasr-wss-client.cpp b/runtime/websocket/bin/funasr-wss-client.cpp
index f617998..dddab8e 100644
--- a/runtime/websocket/bin/funasr-wss-client.cpp
+++ b/runtime/websocket/bin/funasr-wss-client.cpp
@@ -342,6 +342,7 @@
 
 int main(int argc, char* argv[]) {
 #ifdef _WIN32
+    #include <windows.h>
     SetConsoleOutputCP(65001);
 #endif
     google::InitGoogleLogging(argv[0]);
diff --git a/runtime/websocket/bin/funasr-wss-server-2pass.cpp b/runtime/websocket/bin/funasr-wss-server-2pass.cpp
index 40f8f07..965f2a8 100644
--- a/runtime/websocket/bin/funasr-wss-server-2pass.cpp
+++ b/runtime/websocket/bin/funasr-wss-server-2pass.cpp
@@ -25,6 +25,10 @@
 }
 
 int main(int argc, char* argv[]) {
+#ifdef _WIN32
+  #include <windows.h>
+  SetConsoleOutputCP(65001);
+#endif
   try {
     google::InitGoogleLogging(argv[0]);
     FLAGS_logtostderr = true;
diff --git a/runtime/websocket/bin/funasr-wss-server.cpp b/runtime/websocket/bin/funasr-wss-server.cpp
index 67e3309..8f2a7ab 100644
--- a/runtime/websocket/bin/funasr-wss-server.cpp
+++ b/runtime/websocket/bin/funasr-wss-server.cpp
@@ -26,6 +26,10 @@
 }
 
 int main(int argc, char* argv[]) {
+#ifdef _WIN32
+    #include <windows.h>
+    SetConsoleOutputCP(65001);
+#endif
   try {
 
     google::InitGoogleLogging(argv[0]);

--
Gitblit v1.9.1