about coding

Paul Watson pwatson at redlinepy.com
Thu Aug 11 14:11:24 EDT 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 ?
> 
> Thanks.

You must know the encoding produced by your editor.

If you want to experiment, you could save a small file and run

     od -Ax -tx1 thefile.py

to see exactly what codepoints appear.  Compare those with the
charts at http://www.unicode.org/ and you can probably surmize
a good guess.



More information about the Python-list mailing list