John Roth wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> I'm using feedparser to parse the following: >> >> <div class="indent text">Adv: Termite Inspections! Jenny Moyer welcomes >> you to her HomeFinderResource.com TM A "MUST See &hellip;</div> >> >> I'm receiveing the following error when i try to print the feedparser >> parsing of the above text: >> >> UnicodeEncodeError: 'latin-1' codec can't encode character u'\u201c' in >> position 86: ordinal not in range(256) >> >> Why is this happening and where does the problem lie? > > > Several different things are going on here. First, when you try to > print a unicode string using str() or a similar function, Python is > going to > use the default encoding to render it. The default encoding is usually > ASCII-7. Why it's trying to use Latin-1 in this case is somewhat > of a mystery.
Actually I believe it will use sys.stdout.encoding for this, which is presumably latin-1 on fingermark's machine. Kent -- http://mail.python.org/mailman/listinfo/python-list