The strings you get are probably UTF8. Can you confirm? On Wednesday, 4 November 2015 08:19:41 UTC-6, Dandelion Mine wrote: > > Hello! > According to Web2py book, 'by default web2py uses utf8 character encoding > for databases'. I get the contrary results: there are fields with type > 'string', mysql shows that they have collation utf8_general_ci, but when I > select them with DAL, the type of returned fields are 'str', not 'unicode'. > > db.define_table('customers', > Field('name', 'string')) > > +-----------+--------------+-----------------+------ > | Field | Type | Collation | Null | Key | > +-----------+--------------+-----------------+------+ > | name | varchar(512) | utf8_general_ci | > > print type(db(db.tradera_customers).select().first().name) > <type 'str'> > > I tried to remove *.table in databases and to use db_codec parameter for > DAL, but nothing changed. > > Web2py version 2.9.11-stable, Python 2.7.9, MySQL ver 14.14 Distrib 5.5.40 > > Is it a known bug or I'm doing something wrong? > Thanks in advance. >
-- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.