Re: helping with unicode

2012-07-02 Thread Terry Reedy
On 7/2/2012 8:49 PM, self.python wrote: it's a simple source view program. the codec of the target website is utf-8 so I read it and print the decoded which re-encodes before printing -- #-*-coding:utf8-*- import urllib2 rf=urllib2

Re: helping with unicode

2012-07-02 Thread Terry Reedy
On 7/2/2012 8:49 PM, self.python wrote: it's a simple source view program. the codec of the target website is utf-8 so I read it and print the decoded which re-encodes before printing -- #-*-coding:utf8-*- import urllib2 rf=urllib2

Re: helping with unicode

2012-07-02 Thread MRAB
On 03/07/2012 01:49, self.python wrote: it's a simple source view program. the codec of the target website is utf-8 so I read it and print the decoded -- #-*-coding:utf8-*- import urllib2 rf=urllib2.urlopen(r"http://gall.dcinside.com/

Re: helping with unicode

2012-07-02 Thread Andrew Berg
On 7/2/2012 7:49 PM, self.python wrote: > > Traceback (most recent call last): > File "C:wrong.py", line 8, in > print rf.read().decode('utf-8') > UnicodeEncodeError: 'cp949' codec can't encode character u'u1368' in position >

helping with unicode

2012-07-02 Thread self.python
it's a simple source view program. the codec of the target website is utf-8 so I read it and print the decoded -- #-*-coding:utf8-*- import urllib2 rf=urllib2.urlopen(r"http://gall.dcinside.com/list.php?id=programming";) print rf.read(