1
0
mirror of synced 2024-11-23 22:00:56 +01:00

Made a bad assumption, all outputs will be UTF-8 which is more reliable.

This commit is contained in:
Alexankitty 2023-01-05 22:15:06 -07:00
parent a54bb03723
commit 356c9051a0
2 changed files with 7 additions and 6 deletions

View File

@ -484,7 +484,7 @@ namespace TJAConvert
file.AddRange(lines.GetRange(course.SongDataIndexStart, course.SongDataIndexEnd - course.SongDataIndexStart + 1)); file.AddRange(lines.GetRange(course.SongDataIndexStart, course.SongDataIndexEnd - course.SongDataIndexStart + 1));
var path = $"{directory}/{fileName}.tja"; var path = $"{directory}/{fileName}.tja";
File.WriteAllLines(path, file, encoding); File.WriteAllLines(path, file);
var passed = await Convert(path, directory, tjaHash); var passed = await Convert(path, directory, tjaHash);
if (passed < 0) if (passed < 0)
@ -500,7 +500,7 @@ namespace TJAConvert
} }
} }
File.WriteAllLines(newPath, lines, encoding); File.WriteAllLines(newPath, lines);
return 0; return 0;
} }
@ -526,7 +526,7 @@ namespace TJAConvert
lines.Insert(course.CourseDataIndexStart + 1 + courseData.Count, ""); lines.Insert(course.CourseDataIndexStart + 1 + courseData.Count, "");
} }
File.WriteAllLines(newPath, lines, encoding); File.WriteAllLines(newPath, lines);
try try
{ {
@ -548,7 +548,7 @@ namespace TJAConvert
return passed; return passed;
} }
File.WriteAllLines(newPath, lines, encoding); File.WriteAllLines(newPath, lines);
return 0; return 0;
} }
@ -648,7 +648,7 @@ namespace TJAConvert
var encoding = FileEncoding.DetectFileEncoding(tjaPath); var encoding = FileEncoding.DetectFileEncoding(tjaPath);
var lines = ApplyGeneralFixes(File.ReadAllLines(tjaPath, encoding).ToList()); var lines = ApplyGeneralFixes(File.ReadAllLines(tjaPath, encoding).ToList());
File.WriteAllLines(newPath, lines, encoding); File.WriteAllLines(newPath, lines);
var currentDirectory = Environment.CurrentDirectory; var currentDirectory = Environment.CurrentDirectory;
var exePath = $"{currentDirectory}/tja2bin.exe"; var exePath = $"{currentDirectory}/tja2bin.exe";
@ -705,7 +705,7 @@ namespace TJAConvert
} }
//Provide useful output when the metadata is bad //Provide useful output when the metadata is bad
if (result.Contains("invalid Metadata")) if (result.Contains("invalid metadata"))
{ {
Console.WriteLine(result); Console.WriteLine(result);
return -2; return -2;

View File

@ -35,6 +35,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Folder Include="UDE.CSharp\" />
<Folder Include="References" /> <Folder Include="References" />
</ItemGroup> </ItemGroup>