From 159c587c2e173b25e7769652665c2ace8860a4d3 Mon Sep 17 00:00:00 2001 From: Autumn-27 <53844290+Autumn-27@users.noreply.github.com> Date: Sat, 12 Sep 2026 05:32:09 -0400 Subject: [PATCH] =?UTF-8?q?fix(script):=20start.bat=20=E6=94=B9=E7=94=A8?= =?UTF-8?q?=20CRLF=20=E5=B9=B6=E5=88=87=20UTF-8=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit start.bat 之前是 LF 换行。cmd.exe 解析批处理按字节偏移边读边执行, 只认 \r\n,全 LF 时会读串行,表现为 goto loop 被截断成 'oop'、 "75"( 不是内部或外部命令、: 运算符不存在等一连串报错,脚本根本跑不起来。 同时文件是 UTF-8 无 BOM,中文控制台默认 GBK(936),注释和 echo 全是乱码。 - 顶部加 chcp 65001,中文提示正常显示(artex 本身输出也是 UTF-8) - 新增 .gitattributes:*.bat 钉 eol=crlf、*.sh 钉 eol=lf, 避免在 Linux 上编辑或重新 checkout 后又被打回 LF --- .gitattributes | 2 ++ start.bat | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d78c7d0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +*.bat text eol=crlf +*.sh text eol=lf diff --git a/start.bat b/start.bat index b891aa0..0ae849b 100644 --- a/start.bat +++ b/start.bat @@ -1,4 +1,6 @@ @echo off +rem 控制台切 UTF-8,否则本文件里的中文在 GBK 终端下是乱码。 +chcp 65001 >nul 2>&1 rem ARTEX 守护启动脚本(Windows) rem rem 用法: