[Pythonmac-SIG] ascii <-> unicode <-> cocoa NSString

Opstad, Dave dave.opstad at monotypeimaging.com
Mon Feb 20 22:37:07 CET 2006


On 2/20/06 1:05 PM, "Keith Ray" <keith.ray at gmail.com> wrote:

> Help ?

You encode from Unicode, and decode to Unicode:

>>> 'hi there'.decode('ascii')
u'hi there'
>>> u'hi there'.encode('ascii')
'hi there'

Dave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060220/eadbe5f4/attachment.html 


More information about the Pythonmac-SIG mailing list