mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Remove BOM from log and config files
This commit is contained in:
1 parent
9bed791bd6
commit
9d59aaae79
3 files changed
+7
-2
No files matched your search
@@ -281,7 +281,7 @@ namespace BepInEx.Configuration
|
||||
var directoryName = Path.GetDirectoryName(ConfigFilePath);
|
||||
if (directoryName != null) Directory.CreateDirectory(directoryName);
|
||||
|
||||
using (var writer = new StreamWriter(ConfigFilePath, false, Encoding.UTF8))
|
||||
using (var writer = new StreamWriter(ConfigFilePath, false, Utility.UTF8NoBom))
|
||||
{
|
||||
if (_ownerMetadata != null)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace BepInEx.Logging
|
||||
localPath = $"LogOutput.{counter++}.log";
|
||||
}
|
||||
|
||||
LogWriter = TextWriter.Synchronized(new StreamWriter(fileStream, Encoding.UTF8));
|
||||
LogWriter = TextWriter.Synchronized(new StreamWriter(fileStream, Utility.UTF8NoBom));
|
||||
|
||||
if (delayedFlushing) FlushTimer = new Timer(o => { LogWriter?.Flush(); }, null, 2000, 2000);
|
||||
|
||||
|
||||
@@ -22,6 +22,11 @@ namespace BepInEx
|
||||
/// <see cref="System.Reflection.Emit" /> namespace.
|
||||
/// </summary>
|
||||
public static bool CLRSupportsDynamicAssemblies => CheckSRE();
|
||||
|
||||
/// <summary>
|
||||
/// An encoding for UTF-8 which does not emit a byte order mark (BOM).
|
||||
/// </summary>
|
||||
public static Encoding UTF8NoBom { get; } = new UTF8Encoding(false);
|
||||
|
||||
private static bool CheckSRE()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user