In our application, we receive text files (.txt
, .csv
, etc.) from diverse sources. When reading, these files sometimes contain garbage, because the
I know it's very late for this question and this solution won't appeal to some (because of its english-centric bias and its lack of statistical/empirical testing), but it's worked very well for me, especially for processing uploaded CSV data:
http://www.architectshack.com/TextFileEncodingDetector.ashx
Advantages:
Note: I'm the one who wrote this class, so obviously take it with a grain of salt! :)