Re: [Tutor] Assistance with UnicodeDecodeError

2015-02-04 Thread James Chapman
Actually, it's more likely that the char you are grabbing is UTF-16 not UTF-8 which is moving into the double byte... * An assumption based on the following output: u = u'\u2014' s = u.encode(utf-16) print(s) ■¶ s = u.encode(utf-32) print(s) ■ ¶ s = u.encode(utf-16LE) print(s) ¶ s =

Re: [Tutor] Assistance with UnicodeDecodeError

2015-02-04 Thread James Chapman
I am trying to scrap text from a website using Python 2.7 in windows 8 and i am getting this error ***UnicodeDecodeError: 'charmap codec can't encode character u'\u2014 in position 11231 character maps to undefined* For starters, move away from Python 2 unless you have a good reason to use

Re: [Tutor] Assistance with UnicodeDecodeError

2015-02-02 Thread Cristian Di Stefano
Hi Dave, you should set the correct encoding (maybe utf-8) in order to handle data from web. You cannot handle unicode data with simple string, you should encode to ASCII or manage data with the unicode type Best Cristian Il 31/01/2015 23:44, Dave Angel ha scritto: On 01/31/2015 08:37 AM,

Re: [Tutor] Assistance with UnicodeDecodeError

2015-02-02 Thread Dave Angel
On 02/02/2015 02:52 AM, Cristian Di Stefano wrote: Hi Dave, you should set the correct encoding (maybe utf-8) in order to handle data from web. You cannot handle unicode data with simple string, you should encode to ASCII or manage data with the unicode type Best Cristian Please don't

[Tutor] Assistance with UnicodeDecodeError

2015-01-31 Thread J Mberia
Hi, I am teaching myself programming in python and assistance with UnicodeDecodeError I am trying to scrap text from a website using Python 2.7 in windows 8 and i am getting this error ***UnicodeDecodeError: 'charmap codec can't encode character u'\u2014 in position 11231 character maps to

Re: [Tutor] Assistance with UnicodeDecodeError

2015-01-31 Thread Dave Angel
On 01/31/2015 08:37 AM, J Mberia wrote: Hi, Welcome to Python tutor. Thanks for posting using text email, and for specifying both your Python version and Operating system. I am teaching myself programming in python and assistance with UnicodeDecodeError I am trying to scrap text from a