mirror of
https://github.com/imsyy/SPlayer.git
synced 2025-11-25 03:14:57 +08:00
fix: dev.mjs linux/macOS 设置 UTF-8
This commit is contained in:
@@ -39,8 +39,18 @@ if (isWindows) {
|
|||||||
} else {
|
} else {
|
||||||
// macOS 和 Linux 环境
|
// macOS 和 Linux 环境
|
||||||
console.log(`🐧 ${isMacOS ? "macOS" : "Linux"} 环境 - 正在设置 UTF-8 编码`);
|
console.log(`🐧 ${isMacOS ? "macOS" : "Linux"} 环境 - 正在设置 UTF-8 编码`);
|
||||||
env.LC_ALL = "en_US.UTF-8";
|
const langVar = env.LC_ALL || env.LANG;
|
||||||
env.LANG = "en_US.UTF-8";
|
if (langVar.endsWith("UTF-8")) {
|
||||||
|
console.log("✅ 当前环境已设置 UTF-8 编码");
|
||||||
|
} else {
|
||||||
|
if (langVar.startsWith("zh_CN")) {
|
||||||
|
env.LC_ALL = "zh_CN.UTF-8";
|
||||||
|
env.LANG = "zh_CN.UTF-8";
|
||||||
|
} else {
|
||||||
|
env.LC_ALL = "en_US.UTF-8";
|
||||||
|
env.LANG = "en_US.UTF-8";
|
||||||
|
}
|
||||||
|
}
|
||||||
setTimeout(() => startElectronVite(), 0);
|
setTimeout(() => startElectronVite(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user