Skip to content

Commit ff5affd

Browse files
committed
因windows的bat文件仅支持默认编码的中文,故将生成bat文件的编码改为系统默认
1 parent 909a8eb commit ff5affd

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

XlsxToLuaGUI/Utils.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ public static bool SaveFile(string filePath, string content, out string errorStr
4444
{
4545
try
4646
{
47-
StreamWriter writer = new StreamWriter(filePath, false, new UTF8Encoding(false));
47+
Encoding encoding = null;
48+
if (".bat".Equals(Path.GetExtension(filePath)))
49+
encoding = Encoding.Default;
50+
else
51+
encoding = new UTF8Encoding(false);
52+
53+
StreamWriter writer = new StreamWriter(filePath, false, encoding);
4854
writer.Write(content);
4955
writer.Flush();
5056
writer.Close();

XlsxToLuaGUI/XlsxToLuaGUI.v12.suo

5.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)