@hupan56/wlkj 3.3.12 → 3.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
+
# Windows 控制台 UTF-8 修复(ctypes 直调 Windows API;所有经 bootstrap 引导的脚本都受益)
|
|
3
|
+
import sys as _s
|
|
4
|
+
if _s.platform == 'win32':
|
|
5
|
+
import ctypes as _ct, io as _io
|
|
6
|
+
try:
|
|
7
|
+
_ct.windll.kernel32.SetConsoleOutputCP(65001)
|
|
8
|
+
_ct.windll.kernel32.SetConsoleCP(65001)
|
|
9
|
+
_s.stdout = _io.TextIOWrapper(_s.stdout.buffer, encoding='utf-8', errors='replace')
|
|
10
|
+
_s.stderr = _io.TextIOWrapper(_s.stderr.buffer, encoding='utf-8', errors='replace')
|
|
11
|
+
except Exception:
|
|
12
|
+
pass
|
|
2
13
|
"""
|
|
3
14
|
bootstrap.py - 统一 CLI 启动样板 (DRY) + 子目录化路径自举 (v3.0)
|
|
4
15
|
|