[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 16106
  • Last Modified:

How do I check a file to find out what encoding has been used for the file?

Hello,
       I need to be able to check a file and determine what encoding has been used when the file was created.

I.e. THe following encoding types are available:

Shift_JIS
UTF-8
EUC-JP
ISO-8859-1

Is there a way of looking at the properties of the file and determining from these what encoding was used?

Thank you for your help.
0
FergusEEAcc
Asked:
FergusEEAcc
  • 6
  • 4
  • 2
1 Solution
 
b0lsc0ttIT ManagerCommented:
FergusEEAcc,

There are various editor programs that will tell you this.  EditPad is one I use and can think of.  Notepad and Windows (i.e. the Properties for the file) does not tell you this.  There may be a third party program that could find this out without being an editor but I do not know of one.  If you have specific way you need to find out then please elaborate and I will see what I can tell you.

If you are looking for a free way to do it then try opening it in your browser (assuming it is a text file).  The browser will open text files and you can usually see the encoding under the View option.  If you have MS Word it should also show that too.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
FergusEEAccAuthor Commented:
Hello b0lsc0tt, thank you for your help.

You mentioned I could open my text file in a browser, and check under the view option.
By browser, what type of browser do you mean? I presume not a web browser.
I.E. if tried only opens it in notepad (as if I tried it in notepad originally).
The view then just has "Status Bar" as the option.

If I open the file in Word, what option under "View" do you think should provide the correct details?

Thank you again!
0
 
b0lsc0ttIT ManagerCommented:
Actually I did mean a web browser (e.g. IE or Firefox).  Of course this assumes the file type is a "text" file as you described above.  To open it in a browser you would right click on it and choose Open With.  Select your browser, for example IE, from the list of programs and make sure the checkbox to Always use (or whatever the exact wording) is NOT checked.  You don't want Windows to always do this. :)

If you open the file with Word that program will usually bring up a box for you to select the encoding to use.  Look at the choice Word defaults to for an idea of what it thinks the encoding is.  There may also be a way to see this once the file is opened but that would depend on your version of Word and could be misleading.

I would avoid trying to use Word for this unless you just used the box that popped up automatically when you opened the file.

bol
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
tree_dCommented:
What kinds of files are they? How were they created? What programs are you using to open the files?
0
 
FergusEEAccAuthor Commented:
Hi tree_d,
     They will be log files created by a web application server.
     Therefore will have either extension .log or .txt (I'm not sure yet).

      To view the encoding type I was not sure how to do so, but cannot seem to check using the instructions (if taking a .txt file for example) from bol above.

Kind Regards.  
0
 
b0lsc0ttIT ManagerCommented:
I just tested the method I suggested that uses the browser.  I tested this in IE 7 but most others should be similar.

1.  Open your browser and make sure the Encoding is set  to Auto Select.  The Encoding option is usually under View or Page.
2.  Right click on the file (txt or log) and choose Open With.  If IE is listed then select it.  Otherwise choose specify program.  When you choose IE make sure you do not have an option checked to make this the default for this type.  The option may not be there but check to make sure.
3.  If the file appears and looks good then go to the Encoding setting and see what is selected.  Auto Select will probably still be selected but so should the encoding used.

Let me know if you have a question or need more info.

bol
0
 
FergusEEAccAuthor Commented:
Hello BOl,
        Thank you again.
         If however I open my file using intenet explorer, it then actually opens using notepad (even if notepad also is not selected as the default for opening)        
         I presume I should be viewing my file in IE when opened. and not notepad?

Thank you again.
0
 
b0lsc0ttIT ManagerCommented:
How specifically are you opening the file?

Notepad won't tell you the type but Wordpad may.  Try opening the File in Wordpad and then go to Format -> Font.  Look at the Script setting for the Encoding.

bol
0
 
FergusEEAccAuthor Commented:
Hi,
     If I open in wordpad, the Script setting includes "Western, Hebrew, Arabic.... etc).
    How would I determine from this, which encoding the file was originally created with?

THank you for your help!  
0
 
b0lsc0ttIT ManagerCommented:
From my testing you can tell by looking at what is selected in the Script setting.  You can change the setting so there are other choices but the "default" will be the one used to open the file.

bol
0
 
tree_dCommented:
I would go with the earlier suggestion to use Mozilla Firefox, because it has a specific menu item under the view menu for character encodings, and it will open text files.
0
 
b0lsc0ttIT ManagerCommented:
Sure was a lot of work and info for a B grade!??  Did you still have a question or need some help with this?  If so or the grade was a mistake then let me know.  Otherwise it would be nice to know why the B.  It is always good to have a chance to earn the A or at least know why it wasn't.  If you have a question about grading or what it means on EE then look at http://www.experts-exchange.com/help.jsp#hi97 .

Thanks for the fun question. :)

bol
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 6
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now