[web2py] Re: Encoding using as_dict not using UTF-8?

2010-05-13 Thread b00m_chef
Note that if you are using mySQL that might be because mySQL, if not set to use utf-8 uses a latin encoding. You have to manually tell MySQL to use utf-8, and even then you will still have problems with it...mySQL sux http://lobstertech.com/2009/jun/07/python_unicode_tutorial/ On Apr 12, 6:59 p

[web2py] Re: Encoding using as_dict not using UTF-8?

2010-04-12 Thread mdipierro
I have not looked into this yet. It should be utf8 in both cases. On Apr 12, 8:39 pm, Tito Garrido wrote: > Is it expected? > > On Sun, Apr 11, 2010 at 11:54 AM, Tito Garrido wrote: > > > > > I could test it on Shell, not sure why it's happening: > > > In[0]: > > > p=db(db.paciente.id>0).select()

Re: [web2py] Re: Encoding using as_dict not using UTF-8?

2010-04-12 Thread Tito Garrido
Is it expected? On Sun, Apr 11, 2010 at 11:54 AM, Tito Garrido wrote: > I could test it on Shell, not sure why it's happening: > > In[0]: > > p=db(db.paciente.id>0).select()[1].as_dict() > > Out[0]: > In[1]: > > p > > Out[1]: > > *{'bairro': 'Gra\xc3\xa7a',* 'telefone_residencial': '', 'numero':

Re: [web2py] Re: Encoding using as_dict not using UTF-8?

2010-04-11 Thread Tito Garrido
I could test it on Shell, not sure why it's happening: In[0]: p=db(db.paciente.id>0).select()[1].as_dict() Out[0]: In[1]: p Out[1]: *{'bairro': 'Gra\xc3\xa7a',* 'telefone_residencial': '', 'numero': '492', 'mae': '', 'celular': '', 'pai': '', 'data': '2009-10-20', 'id': 2, 'telefone_comercial

Re: [web2py] Re: Encoding using as_dict not using UTF-8?

2010-04-11 Thread Tito Garrido
In fact looks like it loses the UTF-8 enconding when I print it or convert it to string... Is there a way to re encode it? Regards, tito On Sun, Apr 11, 2010 at 11:35 AM, mdipierro wrote: > Are you tell me that > > items=db(db.mytable.id>0).select(limitby=(0,1)) > print items[0].as_dict() > f

[web2py] Re: Encoding using as_dict not using UTF-8?

2010-04-11 Thread mdipierro
Are you tell me that items=db(db.mytable.id>0).select(limitby=(0,1)) print items[0].as_dict() for item in items: print item.as_dict() produce two different outputs? It cannot be. Massimo On Apr 11, 9:00 am, Tito Garrido wrote: > I can get it as UTF-8 if I execute: > test=db(db.mytable.id>0).s

Re: [web2py] Re: Encoding using as_dict not using UTF-8?

2010-04-11 Thread Tito Garrido
I can get it as UTF-8 if I execute: test=db(db.mytable.id>0).select()[0].as_dict() return test Not sure why it's not encoding on the former situation. How could I convert it manually? Thanks! On Sun, Apr 11, 2010 at 2:15 AM, mdipierro wrote: > I am not sure the issue is web2py here. It may b

[web2py] Re: Encoding using as_dict not using UTF-8?

2010-04-10 Thread mdipierro
I am not sure the issue is web2py here. It may be 1) the encoding in the db should be utf8 and it is not, 2) the data has been stored incorrecly. web2py does not convert data to UTF8 when extracting from DB but when inserting only. On Apr 10, 11:17 pm, Tito Garrido wrote: > Hi Folks, > > I'm not