[Tutor] Problems with encodings

Olli Rajala olli.rajala at gmail.com
Mon Apr 18 08:22:28 CEST 2005


Hi!
Been offlist for a while, but now I started to code an administration
tool for my own photo gallery and have some troubles, so thought to
write and ask some help. :)

So, I'm from Finland and I'm using ISO-8859-15 -encoding but Python
don't "understand" letters outside ASCII. I've read PEP-0263 and tried
to add the encoding line to my sources, but it doesn't help. Here's a
little example:

#!/usr/bin/python2.4
# -*- coding: <iso-8859-15> -*- 
def printHeader():
    print "ääää"   

Don't know how you see the 4th line, but that's not my "problem", is it? ;)

And I got this error message:
"sys:1: DeprecationWarning: Non-ASCII character '\xe4' in file
generalHtml.py on line 11, but no encoding declared; see
http://www.python.org/peps/pep-0263.html for details"

I code with Kate (2.4, KDE 3.4.0) and everything else works well when
speaking about this encoding thing. I really hope that someone would
know a solution. I don't mind if I have to write only ASCII but I'm
not the only user for that tool, so...

Yours sincerely, 
-- 
Olli Rajala <><
Tampere, Finland
http://www.students.tut.fi/~rajala37/

"In theory, Theory and Practice should be
the same. But in practice, they aren't."
- Murphy's Proverbs


More information about the Tutor mailing list