How to find out the Encoding of a File? C#

后端 未结 5 922
感情败类
感情败类 2020-12-01 10:56

Well i need to find out which of the files i found in some directory is UTF8 Encoded either ANSI encoded to change the Encoding in something else i decide later. My problem

5条回答
  •  执念已碎
    2020-12-01 11:51

    See these two codeproject articles - it is not trivial to find out file encoding simply from the file content:

    • Detect encoding from ByteOrderMarks (BOM)
    • Detect Encoding for In- and Outgoing Text

提交回复
热议问题