Fuzzyman wrote:
Mike Dee wrote:

#!/usr/bin/env python
# -*- coding: UTF-8 -*-

This will mean string literals in your source code will be encoded as
UTF8 - if you handle them with normal string operations you might get
funny results.

It means that you don't have to explicitely set the encoding on strings.

If your coding isn't set you must write:

ust = 'æøå'.decode('utf-8')

If it is set, you can just write:

ust = u'æøå'

And this string will automatically be utf-8 encoded:

st = 'æøå'

So you should be able to convert it to unicode without giving an encoding:

ust = unicode(st)

--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to