[Zope] unicode error

Charles Sebold csebold@livingtorah.org
Tue, 27 Aug 2002 07:44:50 -0500


On 19 Elul 5762, Christopher N. Deckard wrote:

> How do I get around this?
> 
> Error Type: UnicodeError
> Error Value: ASCII decoding error: ordinal not in range(128)
> 
> There are non-ascii characters stored in properties of folders and
> I'm trying to build an xml string to send off to a ParsedXML object
> for parsing.  Do I need to encode with a different encoding?  I'm
> basically doing:
> 
>    XMLstring = XMLstring + new_part_from_folder_property

Would something like this help?

XMLstring = XMLstring +
            new_part_from_folder_property.encode('latin-1','replace')

I had to do something like this when messing around with results from
the GoogleAPI beta.  If something other than "latin-1" is appropriate
then replace that.
-- 
Charles Sebold        K'tivah V'chatimah Tovah        19th of Elul, 5762
               http://www.livingtorah.org/Zope/journal