Skip to content

Commit

Permalink
Change saved song file encoding to UTF-8 without BOM
Browse files Browse the repository at this point in the history
Previously the encoding was System.Text.Encoding.UTF8, which produces a BOM at the beginning of the saved file. Now it is a new System.Text.UTF8Encoding, which does not produce a BOM.
  • Loading branch information
Tuupertunut authored Dec 27, 2023
1 parent 661be85 commit f642567
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ public static class UltraStarSongFileWriter
public static void WriteFile(string absolutePath, SongMeta songMeta)
{
string txtFileContent = GetTxtFileContent(songMeta);
File.WriteAllText(absolutePath, txtFileContent, Encoding.UTF8);
// Do not use Encoding.UTF8 as it will produce a BOM.
File.WriteAllText(absolutePath, txtFileContent, new UTF8Encoding());
}

private static string GetTxtFileContent(SongMeta songMeta)
Expand Down

0 comments on commit f642567

Please sign in to comment.