Re: [Tutor] Problems with encoding in BeautifulSoup

2009-08-18 Thread Eduardo Vieira
On Tue, Aug 18, 2009 at 5:59 AM, Kent Johnson wrote: > On Tue, Aug 18, 2009 at 12:18 AM, Mal Wanstall wrote: >> On Tue, Aug 18, 2009 at 9:00 AM, Eduardo Vieira >> wrote: > >>> Here is the Error output: >>> utf-8 >>> Traceback (most recent call last): >>>  File "C:\myscripts\encondingproblem.py", l

Re: [Tutor] Problems with encoding in BeautifulSoup

2009-08-18 Thread Serdar Tumgoren
> Setting sys.setdefaultencoding() affects all scripts you run and will > make scripts that you write non-portable. A better solution is to > properly encode the output, for example > for company in companies[:4]: # assuming companies is a list >  print company.encode('cp437') > Kent's suggestion a

Re: [Tutor] Problems with encoding in BeautifulSoup

2009-08-18 Thread Kent Johnson
On Tue, Aug 18, 2009 at 12:18 AM, Mal Wanstall wrote: > On Tue, Aug 18, 2009 at 9:00 AM, Eduardo Vieira > wrote: >> Here is the Error output: >> utf-8 >> Traceback (most recent call last): >>  File "C:\myscripts\encondingproblem.py", line 13, in >>    print companies[:4] >> UnicodeEncodeError: '

Re: [Tutor] Problems with encoding in BeautifulSoup

2009-08-17 Thread Mal Wanstall
On Tue, Aug 18, 2009 at 9:00 AM, Eduardo Vieira wrote: > Hello, I have this sample script from beautiful soup, but I keep > getting an error because of encoding. I have google for solutions but > I don't seem to understand. Even this is dealt in Beautiful Soup's doc > but I am not able to understan

[Tutor] Problems with encoding in BeautifulSoup

2009-08-17 Thread Eduardo Vieira
Hello, I have this sample script from beautiful soup, but I keep getting an error because of encoding. I have google for solutions but I don't seem to understand. Even this is dealt in Beautiful Soup's doc but I am not able to understant/apply the solution successfully. from BeautifulSoup import B