Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a textfile and I want to know whether it is Ascii or UTF-8 or something else. How can I see this? Any tool or website that I can use?

share|improve this question
4  
Unless the file contains a BOM there is no 100%-sure way of doing this. –  Ignacio Vazquez-Abrams Dec 29 '10 at 9:03
    
@Ignacio Vazquez-Abrams I cannot recall ever opening a file in Notepad++ where something related to the encoding was not displayed in the bottom right hand corner of the screen, but maybe I have never run into a file without a BOM. Even if a file didn't contain a BOM, couldn't a person just open a file in Notepad++ as I suggested in my answer and select from the various encoding settings until one looked right? Then we would know the selected setting was the encoding of the file. –  ubiquibacon Dec 29 '10 at 13:54
    
@typoknig: Assuming the person going through the various encodings has some idea of what it's supposed to look like, sure. But it is possible to fool people with some of the old DOS codepages. –  Ignacio Vazquez-Abrams Dec 29 '10 at 14:17

2 Answers 2

up vote 1 down vote accepted
$ file unicode.txt
unicode.txt: UTF-8 Unicode text

I expect the file utility is available for Windows as part of CygWin

I'm surprised it isn't included in UnxUtils or GNU CoreUtils for Windows

As Ignacio Vazquez-Abrams suggests, for many files, software tools can only make a guess based on sampling and probabilites.

share|improve this answer
1  
It was never a part of coreutils. gnuwin32.sourceforge.net/packages/file.htm –  Ignacio Vazquez-Abrams Dec 29 '10 at 12:11
    
+1 for "file for windows" –  RedGrittyBrick Dec 29 '10 at 12:16

Use Notepad ++. The information you are looking for is displayed in the bottom right hand corner of the screen.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.