LinuxQuestions.org
Review your favorite Linux distribution.
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 11-15-2005, 07:02 AM   #1
Anden008
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, 07:38 AM   #2
otoomet
Member
 
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
Code:
\usepackage[latin1]{inputenc}
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,
Ott
 
Old 11-15-2005, 07:56 AM   #3
wimnat
Member
 
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, 02:07 PM   #4
Anden008
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.
 
  


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

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

All times are GMT -5. The time now is 10: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