<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7650.5">
<TITLE>Re: [Pythonmac-SIG] ascii <-> unicode <-> cocoa NSString</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>On 2/20/06 1:05 PM, "Keith Ray" <keith.ray@gmail.com> wrote:<BR>
<BR>
> Help ?<BR>
<BR>
You encode from Unicode, and decode to Unicode:<BR>
<BR>
>>> 'hi there'.decode('ascii')<BR>
u'hi there'<BR>
>>> u'hi there'.encode('ascii')<BR>
'hi there'<BR>
<BR>
Dave<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>