[Grok-dev] Problem with character encoding

Sebastian Ware sebastian at urbantalk.se
Tue Jul 8 17:29:31 EDT 2008

I know this is slightly off topic but maybe there is a simple answer.

I have a unicode attribute [message] of an object stored in the ZODB  
and I want to encode it to "iso-8859-1" and the use urllib.urlencode  
to create parameters for a http post operation.

The problem is that the characters "åäöÅÄÖ" are encoded to this:


but should be encoded to this:


I notice the following (the first one is what I want):

    >> u'å'.encode('iso-8859-1')
    >> self.context.message[0].encode('iso-8859-1')

Any hints?

Mvh Sebastian

More information about the Grok-dev mailing list