LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-31-2007, 04:03 PM   #1
mike_stlouis
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Rep: Reputation: 0
finding the encoding of a file


if i have a file and i'm not sure exactly how it's encoded, how can i find out? the file i was working with was an actuate reporting file with a .bas extionsion and ended up bein utf-16, but i was just wondering for future reference if there's some view option or command i can run to tell me exactly how a file is encoded.
thanks in advance!
mike.
 
Old 10-31-2007, 04:32 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
check the file command... http://unixhelp.ed.ac.uk/CGI/man-cgi?file may be useful to you.
 
Old 11-01-2007, 08:47 AM   #3
dansmith127
LQ Newbie
 
Registered: Apr 2007
Distribution: Ubuntu 7.10
Posts: 21

Rep: Reputation: 15
Not possible

As far as I can tell there is no way to tell the encoding.

file yourfilename

can tell you whether it's ASCII text or not, but not the encoding. Essentially the encoding is context-dependent and nothing in the file as such defines it.

This thread: http://discuss.fogcreek.com/joelonso...w&ixPost=82874 goes through some of the issues and misunderstandings regarding character encoding.

file -i filename

will give you the MIME type, which can be useful, but it's not what you're seeking. It can't tell you the character encoding.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
convert file from UTF8 to ASCII encoding graemef Programming 8 12-15-2008 04:45 AM
Script to determine file encoding maxmil Linux - General 3 09-13-2008 03:26 AM
file encoding yuubouna Linux - General 3 01-16-2007 01:47 AM
determine encoding type of a file (ie - UTF-8) chovy Linux - Software 1 04-03-2006 12:46 AM
encoding for ReiserFS file names? uselpa Slackware 1 11-15-2005 04:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration