Skip to content

Instantly share code, notes, and snippets.

View maxiwheat's full-sized avatar

Philippe Meunier maxiwheat

View GitHub Profile
@maxiwheat
maxiwheat / TextFileEncodingDetector.cs
Last active November 1, 2022 16:15 — forked from TaoK/TextFileEncodingDetector.cs
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
{
/*