Browse Source

fix: gbk codec

DevDengChao 8 months ago
parent
commit
9335b7a052
1 changed files with 3 additions and 0 deletions
  1. 3 0
      sql/tools/convertor.py

+ 3 - 0
sql/tools/convertor.py

@@ -24,6 +24,9 @@ from typing import Dict, Generator, Optional, Tuple, Union
 
 from simple_ddl_parser import DDLParser
 
+# 避免 Windows 系统使用默认的 GBK 编码
+sys.stdout = open(sys.stdout.fileno(), mode='w', encoding='utf-8', buffering=1)
+
 PREAMBLE = """/*
  Yudao Database Transfer Tool