The most important thing that you are missing is that you need to know
the encoding used for the 8-bit-character string. Let's guess that it's
Latin1.
Then all you have to do is use the unicode() builtin function, or the
string decode method.
# >>> s =  'Jos\xe9'
# >>> s
# 'Jos\xe9'
# >>> u = unicode(s, 'latin1')
# >>> u
# u'Jos\xe9'
# >>> u2 = s.decode('latin1')
# >>> u2
# u'Jos\xe9'

Other important things:
(1) Using eval() is not usually the best way to do things.
(2) If your code is not in entirely in ASCII, put a coding declaration
at the top of the source file.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to