[Python] psycopg2, utf8, sqlalchemy, etc.

Marco Mariani marco.mariani a prometeia.it
Dom 24 Gen 2010 12:54:27 CET


Premessa: collegamento da SQLAlchemy a postgres con encoding UTF-8

A quanto ho capito, sia Django che SQLAlchemy operano la decodifica
verso unicode all'interno dell'ORM

Infatti, con le query sqlalchemy.select() e compagnia che non usano
l'ORM, l'onere della decodifica e' lasciato all'applicazione.

A mio avviso, il margine per l'errore umano (nessuna decodifica o
tentativo di decodifica doppia) e' alto.

Stavo pensando a un Proxy per ogni riga restituita (o meglio ancora un
Proxy sull'oggetto ResultProxy) ma credo si possa trovare una soluzione
piu' performante e meno complessa.

Oggi sono pigro e vi chiedo: voi siete appagati da questa situazione?
Come l'affrontate?

grazie

-- 
This e-mail (and any attachment(s)) is strictly confidential and for use only by intended recipient(s). Any use, distribution, reproduction or disclosure by any other person is strictly prohibited. The content of this e-mail does not constitute a commitment by the Company except where provided for in a written agreement between this e-mail addressee and the Company. If you are not an intended recipient(s), please notify the sender promptly and destroy this message and its attachments without reading or saving it in any manner. Any non authorized use of the content of this message constitutes a violation of the obligation to abstain from learning of the correspondence among other subjects, except for more serious offence, and exposes the person responsible to the relevant consequences.

-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: http://lists.python.it/pipermail/python/attachments/20100124/c97d3846/attachment.htm 


Maggiori informazioni sulla lista Python