mirror of
https://github.com/alexhopeoconnor/dnsmasq-webui.git
synced 2026-10-13 15:31:17 +10:00
- 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
10 lines
320 B
C#
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);
|
|
}
|