Automatically detect text file encoding

Denis Sav 21 Reputation points
2022-10-22T13:32:52.813+00:00

Hello everyone.
Would like me to try this code from the link below in my app.
Thanks to GitHub, this Class automatically detects the code page from the text file.
But I don't know how to call this class in my application, I don't know how to use this class...
For example, if my file is located in the path: C:\TestFolder\Test.txt, how can I detect code page of this file Test.txt.
He is asking for your help. Thanks in advance.

Link of GitHub class:
https://gist.github.com/TaoK/945127

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,844 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.