diff --git a/FreeMote.PsBuild/PsbCompiler.cs b/FreeMote.PsBuild/PsbCompiler.cs index 68d8f96..a29fb01 100644 --- a/FreeMote.PsBuild/PsbCompiler.cs +++ b/FreeMote.PsBuild/PsbCompiler.cs @@ -13,7 +13,7 @@ namespace FreeMote.PsBuild /// public static class PsbCompiler { - public static Encoding Encoding { get; set; } = null; + public static Encoding Encoding { get; set; } = Encoding.UTF8; /// /// Compile to file diff --git a/FreeMote.Tools.PsBuild/Program.cs b/FreeMote.Tools.PsBuild/Program.cs index fdbc1e6..ccaac58 100644 --- a/FreeMote.Tools.PsBuild/Program.cs +++ b/FreeMote.Tools.PsBuild/Program.cs @@ -94,6 +94,7 @@ PsBuild link -o Order sample.psb tex000.png tex001.bmp try { _encoding = Encoding.GetEncoding(optEncoding.ParsedValue); + PsbCompiler.Encoding = _encoding; } catch (ArgumentException e) { @@ -134,6 +135,7 @@ PsBuild port -p win sample.psb try { _encoding = Encoding.GetEncoding(optEncoding.ParsedValue); + PsbCompiler.Encoding = _encoding; } catch (ArgumentException e) { @@ -217,6 +219,7 @@ PsBuild port -p win sample.psb try { _encoding = Encoding.GetEncoding(optEncoding.ParsedValue); + PsbCompiler.Encoding = _encoding; } catch (ArgumentException e) { @@ -273,6 +276,7 @@ PsBuild replace sample.psb sample.json try { _encoding = Encoding.GetEncoding(optEncoding.ParsedValue); + PsbCompiler.Encoding = _encoding; } catch (ArgumentException e) { @@ -387,7 +391,6 @@ private static void Compile(string s, ushort? version, uint? key, PsbSpec? spec, Console.WriteLine($"Compiling {name} ..."); try { - PsbCompiler.Encoding = _encoding; //var filename = name + (_key == null ? _noRename ? ".psb" : "-pure.psb" : "-impure.psb"); var filename = name + ".psb"; //rename later //TODO: support set output path PsbCompiler.CompileToFile(s, filename, null, version, key, spec, canRename, canPackShell);