about coding

Benjamin Niemann pink at odahoda.de
Sat Aug 6 13:36:35 CEST 2005

cantabile wrote:

> Hi, being a newbie in Python, I'm a bit lost with the '-*- coding : -*-'
> directive.
> I'm using an accented characters language. Some of them are correctly
> displayed while one doesn't. I've written :
> -*- coding: utf-8 -*-
> Is this wrong ?
> Where can I find a pratical explanation about these encodings ?

The coding line tell the interpreter to assume that the file is encoded as
utf-8. It's the job of the editor that you are using, to actually encode
the file as utf-8.
The coding directive uses a format that is automatically recognized by the
emacs editor. If you are using another editor, you'll have to search its
menus for the proper way to save files as utf-8.

Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/

More information about the Python-list mailing list