newbie question about unicode

Genie T nguyenhuuthanh at gmail.com
Sat Jun 23 03:01:26 EDT 2007


On Jun 23, 12:04 pm, "Carsten Haese" <cars... at uniqsys.com> wrote:
> On Sat, 23 Jun 2007 04:10:19 -0000, Genie T wrote
>
> > Hi,
>
> > can anybody tell me whether these two expressions have the same
> > meanings?
>
> > s = u'<unicode string here>'
> > s1 = s.encode('utf-8')
>
> > AND
>
> > s1 = unicode(s,'utf-8')
>
> Considering that one works and the other doesn't, no, they don't have the same
> meaning.
>
> 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 readhttp://www.amk.ca/python/howto/unicode
>
> HTH,
>
> --
> Carsten Haesehttp://informixdb.sourceforge.net

thanks for the link, i'm trying to understand more about this unicode
handling :)




More information about the Python-list mailing list