On Sat, 15 Nov 2008 14:12:42 +0100, Gilles Ganault wrote:
> On Fri, 14 Nov 2008 17:39:00 +0100, "Martin v. Löwis"
> <[EMAIL PROTECTED]> wrote:
>>Can you first please report what happened when you add the print
>>statement?
>
> Thanks guys, I found how to handle this:
>
> ===
> for id in
On Fri, 14 Nov 2008 17:39:00 +0100, "Martin v. Löwis"
<[EMAIL PROTECTED]> wrote:
>Can you first please report what happened when you add the print statement?
Thanks guys, I found how to handle this:
===
for id in rows:
#Says Unicode, but it's actually not
#print type(id[1]
Gilles Ganault wrote:
> On Fri, 14 Nov 2008 11:01:27 +0100, "Martin v. Löwis"
> <[EMAIL PROTECTED]> wrote:
>> Add
>>print type(output)
>> here. If it says "unicode", reconsider the next line
>>
>>> print output.decode('utf-8')
>
> In case the string fetc
On Fri, 14 Nov 2008 14:57:42 +0100, Gilles Ganault wrote:
> On Fri, 14 Nov 2008 11:01:27 +0100, "Martin v. Löwis"
> <[EMAIL PROTECTED]> wrote:
>>Add
>>print type(output)
>>here. If it says "unicode", reconsider the next line
>>
>>> print output.decode('u
On Fri, 14 Nov 2008 11:01:27 +0100, "Martin v. Löwis"
<[EMAIL PROTECTED]> wrote:
>Add
>print type(output)
>here. If it says "unicode", reconsider the next line
>
>> print output.decode('utf-8')
In case the string fetched from a web page turns out not to
> print output.decode('utf-8')
> File "C:\Python25\lib\encodings\utf_8.py", line 16, in decode
> return codecs.utf_8_decode(input, errors, True)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe2' in
> position 47:
> ordinal not in range(128)
Notice that it complains abou
Hello
Data that I download from the web seems to be using different code
pages at times, and Python doesn't like this.
Google returned a way to handle this, but I'm still getting an error:
print output.decode('utf-8')
File "C:\Python25\lib\encodings\utf_8.py", line 16, in decode