浏览代码

fix https://github.com/blueloveTH/pocketpy/issues/106

...
blueloveTH 2 年之前
父节点
当前提交
4d9699f290
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src2/main.cpp

+ 6 - 0
src2/main.cpp

@@ -68,6 +68,12 @@ int main(int argc, char** argv){
 
 
     if(argc == 1){
     if(argc == 1){
         void* repl = pkpy_new_repl(vm);
         void* repl = pkpy_new_repl(vm);
+
+#if _WIN32
+        SetConsoleCP(CP_UTF8);
+        SetConsoleOutputCP(CP_UTF8);
+#endif
+
         bool need_more_lines = false;
         bool need_more_lines = false;
         while(true){
         while(true){
             std::cout << (need_more_lines ? "... " : ">>> ");
             std::cout << (need_more_lines ? "... " : ">>> ");