Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-15-2005, 08:02 AM   #1
LQ Newbie
Registered: Nov 2005
Distribution: Ubuntu 10.4
Posts: 29

Rep: Reputation: 15
Encoding of a textfile

Are there a way to see the encoding of a textfile or a tex-file?
And a way to change it?
Old 11-15-2005, 08:38 AM   #2
Registered: Oct 2004
Location: Tartu, Ċrhus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Rep: Reputation: 45
I don't think you can 'see' the encoding.

The problem is that different encodings use different graphical glyphs in a different way. In many cases there is no way to figure out how a particular byte (or byte sequence) should look on the screen. You should try different encodings, look at the results, and decide yourself. Of course, sometimes the guess is pretty trivial.

If the tex-file is made in a polite way, it should include a line like
in the preamble. This gives you a hint that the file uses latin-1 (=iso8859-1) encoding.

To re-encode a file -- I guess most of the modern text editors can do it. Perhaps even browsers, I haven't tried. In emacs you have to visit the file (you have to know the right encoding here) and then press <C-x enter F>. Then you are asked for a new encoding.

There are also various command-line utilities (wasn't one called 'recode'?).

Perhaps it helps,
Old 11-15-2005, 08:56 AM   #3
Registered: Dec 2004
Location: Sydney, AU
Distribution: CentOS 5.x, Backtrack
Posts: 72

Rep: Reputation: 16
if you open a document with kate and then go to view you can set the encoding. The next time you save it should save with the new encoding. I'm not sure about how to find out the original encoding
Old 11-15-2005, 03:07 PM   #4
LQ Newbie
Registered: Nov 2005
Distribution: Ubuntu 10.4
Posts: 29

Original Poster
Rep: Reputation: 15
ok.. I found out that it all worked if I use Western encoding instead of unicode.


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
Textfile from linuxbox to winxpbox arnekasper Linux - Newbie 6 07-15-2005 06:58 AM
textfile editing blubbfish Linux - General 9 10-20-2004 03:00 AM
Help improving a textfile blubbfish Linux - Newbie 2 06-22-2004 09:02 AM
How to exit the less textfile command? dubbuk Linux - Newbie 4 05-03-2004 05:47 PM
PDF to TextFile? Gerardoj Linux - Software 3 09-29-2003 06:00 PM

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

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