Skip to content

Instantly share code, notes, and snippets.

@TaoK
TaoK / TextFileEncodingDetector.cs
Last active October 21, 2024 16:41
Simple class to automatically detect text file encoding, with English-biased "best guess" heuristic based on byte patterns in the absence of BOM.
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
namespace KlerksSoft
{
public static class TextFileEncodingDetector
{
/*