about coding

John Machin sjmachin at lexicon.net
Sat Aug 6 09:29:14 EDT 2005


Benjamin Niemann wrote:
> 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.
> 
> 

or possibly the OP needs to nut out what is the encoding he already has, 
and tell Python what that encoding is.



More information about the Python-list mailing list