On 12 янв, 04:07, jason kirtland <[EMAIL PROTECTED]> wrote: > phasma wrote: > >> What character set is the db-api driver using? Try: > > >> >>> engine.connect().connection.character_set_name() > > >> If it's not utf8, you can configure the driver by adding 'charset=utf8' > >> to your database url. > > > I add charset='utf-8' to 'create_engine' function, but before send > > data(from query) to mako i need decode string from UTF-8 ... > > > How can i do that automatically(decoding) ? > > Use the Unicode column type in your table declarations for these > columns, or for global behavior you can add convert_unicode=True to your > create_engine() arguments (not the url). > > With this driver you can also get some increased efficiency by having it > do the Unicode translation. If all you've added to the engine URL is > 'charset' it should already be in Unicode mode- try adding > 'use_unicode=1' to the url as well if you're not getting Unicode strings > from queries. Full info: > > http://www.sqlalchemy.org/docs/04/sqlalchemy_databases_mysql.html > > Cheers, > Jason
Big thanks ) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
