Files
dnsmasq-webui/src/DnsmasqWebUI/Infrastructure/DnsmasqFileEncoding.cs
T
alex beff128ed9 Fix UTF-8 BOM in dnsmasq config/hosts writes so dnsmasq does not fail
- Add DnsmasqFileEncoding.Utf8NoBom for all config and hosts file writes
- Strip BOM from first line when reading main config and managed config
- Prevents 'bad option at line 1' when dnsmasq loads files written by the app
2026-02-05 03:10:09 +10:00

10 lines
320 B
C#

using System.Text;
namespace DnsmasqWebUI.Infrastructure;
/// <summary>Encoding for dnsmasq config and hosts files. UTF-8 without BOM so dnsmasq does not see a BOM as "bad option" on line 1.</summary>
public static class DnsmasqFileEncoding
{
public static readonly Encoding Utf8NoBom = new UTF8Encoding(false);
}