ermittelt den encoding type einer text datei
public static string GetEncodingTypeAsString(string filePath)
{
string typeAsString = string.Empty;
using(StreamReader sr = new StreamReader(filePath, true))
{
sr.Peek();
typeAsString = sr.CurrentEncoding.BodyName;
}
return typeAsString;
}
29 Kommentare zum Snippet