6 messages in com.googlegroups.pylons-discussRe: UTF8 error
FromSent OnAttachments
Jose Galvez24 Mar 2007 00:45 
Luis Miguel Morillas24 Mar 2007 02:45 
Jose Galvez24 Mar 2007 10:45 
Luis Miguel Morillas24 Mar 2007 11:58 
Jose Galvez24 Mar 2007 17:20 
Jose Galvez24 Mar 2007 22:48 
Subject:Re: UTF8 error
From:Jose Galvez (jj.g@public.gmane.org)
Date:03/24/2007 05:20:57 PM
List:com.googlegroups.pylons-discuss

Thanks for the links, I've never done much with unicode so no I'm not that familiar with it. In any event, thanks again for the links I'll do some reading Jose

Luis Miguel Morillas wrote:

2007/3/24, Jose Galvez <jj.g@public.gmane.org>:

yep I'm on windows.

So if I get the code below, unicodedata.name will tell me what the character actually is, so how do I fix it so that I can actually print it? Right now I'm trying to replace \x92 with ' but that looks fragile. Does anyone know if there is a more generic way of doing this? Jose

Yes, you must configure your app. Do you understand unicode? Read http://www.amk.ca/python/howto/unicode or http://effbot.org/zone/unicode-objects.htm.

Luis Miguel Morillas wrote:

2007/3/24, Jose Galvez <jj.g@public.gmane.org>:

Hi all,

I'm hopping someone an give me a clue about how to handle this problem. I've got an application that gets data from a database and basically feeds the data to another program via json. I just started getting this error:

<type 'exceptions.UnicodeDecodeError'>: 'utf8' codec can't decode byte 0x92 in position 247: unexpected code byte

Are you on windows?

import unicodedata unicodedata.name(unicode('\x92', 'cp1252'))

'RIGHT SINGLE QUOTATION MARK'

print unicode('\x92', 'cp1252')

'

I think that means that I've got some kind of funky code (I don't know what 0x92 would be) in my database. Does anyone know how to get around this?