newbie question about unicode
carsten at uniqsys.com
Sat Jun 23 07:04:12 CEST 2007
On Sat, 23 Jun 2007 04:10:19 -0000, Genie T wrote
> can anybody tell me whether these two expressions have the same
> s = u'<unicode string here>'
> s1 = s.encode('utf-8')
> s1 = unicode(s,'utf-8')
Considering that one works and the other doesn't, no, they don't have the same
The unicode() function decodes a given byte string into a unicode object, but
you're giving it a unicode object. What are you actually trying to achieve?
If you're just trying to get a handle on the topic, I recommend you read
More information about the Python-list