Determine File Encoding


I ran into a problem where I wasn’t sure if I could trust the encoding that my text editor was displaying. I also wanted to check the encoding on about 10,000 files and determine if it was not a specific encoding. So, I created a little program to tell me the encoding of a file. This in combination with powershell allowed me to loop recursively through all the files in a directory and create a list of the files that were not the correct encoding.

A Good portion of the code that I used for this application was available on the another site that describes how to determine the Encoding of a Unicode file.

The application can be downloaded below:

DOWNLOAD: Determine File Encoding

Related Posts:

3 Responses to “Determine File Encoding”

  1. sampe
    sampe Says:

    Hello,

    What exactly this exe should do? I’m looking for exactly the same kind of program, but I didn’t notice anything, when I ran your program.

    I’d appreciate, if you could give me more advice…

  2. Brett Batie
    Brett Says:

    It is a command line program. To run it you open up dos by going to start→run and type cmd.

    Then you run the program by giving it a file to process.

    c:\path\to\FileType.exe c:\path\to\myfile.txt

  3. David
    David Says:

    Hi.

    Been looking for something like this but was wondering. No matter what the encoding is it only seems to return:

    C:\Temp\Perl>FileType.exe expected_chinese.txt
    1252: Western European (Windows)

    I was expecting UTF-8.

    David.

Leave a Reply