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 (583 Downloads)

Related Posts:

4 Responses to “Determine File Encoding”

  1. 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 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 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.

  4. JT Says:

    Same results as David above. Lame…

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.