LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 05: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, 05:32 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
check the file command... http://unixhelp.ed.ac.uk/CGI/man-cgi?file may be useful to you.
 
Old 11-01-2007, 09: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:45 AM
Script to determine file encoding maxmil Linux - General 3 09-13-2008 04:26 AM
file encoding yuubouna Linux - General 3 01-16-2007 02:47 AM
determine encoding type of a file (ie - UTF-8) chovy Linux - Software 1 04-03-2006 01:46 AM
encoding for ReiserFS file names? uselpa Slackware 1 11-15-2005 05:09 PM


All times are GMT -5. The time now is 02:37 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration