We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 82ea11b + fe82fa6 commit ba76665Copy full SHA for ba76665
1 file changed
scripts/dev.mjs
@@ -39,8 +39,18 @@ if (isWindows) {
39
} else {
40
// macOS 和 Linux 环境
41
console.log(`🐧 ${isMacOS ? "macOS" : "Linux"} 环境 - 正在设置 UTF-8 编码`);
42
- env.LC_ALL = "en_US.UTF-8";
43
- env.LANG = "en_US.UTF-8";
+ const langVar = env.LC_ALL || env.LANG;
+ if (langVar.endsWith("UTF-8")) {
44
+ console.log("✅ 当前环境已设置 UTF-8 编码");
45
+ } else {
46
+ if (langVar.startsWith("zh_CN")) {
47
+ env.LC_ALL = "zh_CN.UTF-8";
48
+ env.LANG = "zh_CN.UTF-8";
49
50
+ env.LC_ALL = "en_US.UTF-8";
51
+ env.LANG = "en_US.UTF-8";
52
+ }
53
54
setTimeout(() => startElectronVite(), 0);
55
}
56
0 commit comments