Hi all,
How to retreive unicode data from a mysql table with SQLObject?
When I run this code:
class Foo(SQLObject):
class sqlmeta:
fromDatabase = True
print Foo.select(Foo.q.id==55)[0].bar
...I get:
"?????????? ????????????? ???????? ?? ?????????? ?????? ? ???"
bar's type is mediumtext and collation is utf8_general_ci.
Bests,
Alex
On Mon, Jun 29, 2009 at 10:36:55PM +0400, Alex wrote:
> How to retreive unicode data from a mysql table with SQLObject?
Add 'use_unicode=1' to your DB URI; this will replace all StringCol with
UnicodeCol. Or declare your columns:
class Foo(SQLObject):
bar = UnicodeCol(dbEncoding='utf-8', length=2**16+1)
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.