Re: Help: python unicode

2011-02-17 Thread low kian seong
On Fri, Feb 18, 2011 at 11:40 AM, tom z wrote: > Hi all~ > My script can't work.I've changed my defaultencoding from 'ascii' to > 'utf-8',but Python also raises a 'UnicodeEncodeError' error. > > the error likes this: > > >>> s=u'La Pe\xf1a' > >>>print s > UnicodeEncodeError: 'ascii' codec can't e

Help: python unicode

2011-02-17 Thread tom z
Hi all~ My script can't work.I've changed my defaultencoding from 'ascii' to 'utf-8',but Python also raises a 'UnicodeEncodeError' error. the error likes this: >>> s=u'La Pe\xf1a' >>>print s UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 5: ... And in my script, the