Emacs: how to venvert documents to UTF-8 codepage

Adam Funk a24061 at ducksburg.com
Thu Jun 14 12:41:55 UTC 2007


On 2007-06-14, Alain Muls wrote:

> I use emacs for formatting latex code. I use the utf-8 encoding for documents 
> so that accented characters are correctly handled. When I get documents for 
> my colleague (a notorious windoze user), the accented characters are replaced 
> by somting like \370 which can not be displayed by emacs and which is not 
> correctly compiled by latex.
>
> How can I convert the docuemnts to utf-8 encoding. There is probably a command 
> line utility that can do this, but I have no idea.

>From the command line you can use iconv:

`iconv -f [inputencoding] -t UTF-8 input.file.name > output.file.name`

`iconv -l` will give you a (long) list of all the encodings it can
process.  The file command will probably tell you which windows
encoding the input file uses.


You can also convert files in Emacs itself by opening the file, then
using C-x RET f (set-buffer-file-coding-system), then saving the file
in the newly specified encoding.  However, I don't know how well this
will work if Emacs hasn't correctly recognized the encoding when
opening the file.





More information about the ubuntu-users mailing list