On 2006-11-15 12:38, Jorge Godoy wrote:
> Can you show us the DDL used on the table and the declaration on SQL
> Object / SQL Alchemy? If we can reproduce your tests or see how
> you've done it we can give better answers.
model.py:
class Testtable(ActiveMapper):
class mapping:
pkey = column(Unicode(10), primary_key=True)
test = column(Unicode(4))
dev.cfg:
sqlalchemy.dburi="mysql://test:[EMAIL PROTECTED]/testdb?use_unicode=1"
MySQL started using (make sure, that all is utf8):
mysqld_safe --character-set-server=utf8
Entered the data due to availability via PMA (I am a TG/SA-beginner).
1st machine: Select from tg-admin:
>>> from model import *
>>> t = Testtable.selectone()
>>> t.test
u'\xf6\xf6\xf6\xf6'
>>> print t.test
öööö
2nd machine: Select from tg-admin (don't know, why looks different):
In [1]: from model import *
In [2]: t = Testtable.selectone()
In [3]: t.test
Out[3]: u'\xc3\xb6\xc3\xb6\xc3\xb6\xc3\xb6'
In [4]: print t.test
öööö
"tg-admin info" gives on both machines:
TurboGears Complete Version Information
TurboGears requires:
* TurboGears 1.0b1
* nose 0.9.1
* configobj 4.3.2
* RuleDispatch 0.5a0.dev-r2115
* setuptools 0.6c3
* FormEncode 0.6
* cElementTree 1.0.5-20051216
* PasteScript 1.0
* elementtree 1.2.6-20050316
* simplejson 1.4
* SQLObject 0.7.2b1
* CherryPy 2.2.1
* TurboKid 0.9.9
* TurboCheetah 0.9.5
* TurboJson 0.9.9
* PyProtocols 1.0a0
* Cheetah 2.0rc7
* PasteDeploy 1.0
* Paste 1.0
* FormEncode 0.6
* kid 0.9.3
* Cheetah 2.0rc7
* elementtree 1.2.6-20050316
Identity Providers
* sqlobject (TurboGears 1.0b1)
* sqlalchemy (TurboGears 1.0b1)
tg-admin Commands
* info (TurboGears 1.0b1)
* shell (TurboGears 1.0b1)
* quickstart (TurboGears 1.0b1)
* update (TurboGears 1.0b1)
* sql (TurboGears 1.0b1)
* i18n (TurboGears 1.0b1)
* toolbox (TurboGears 1.0b1)
Visit Managers
* sqlobject (TurboGears 1.0b1)
* sqlalchemy (TurboGears 1.0b1)
Template Engines
* kid (TurboKid 0.9.9)
* cheetah (TurboCheetah 0.9.5)
* json (TurboJson 0.9.9)
Widget Packages
TurboGears Extensions
* visit (TurboGears 1.0b1)
* identity (TurboGears 1.0b1)
Python 1st:
Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Python 2nd:
Python 2.4.4c0 (#2, Jul 30 2006, 18:20:12)
[GCC 4.1.2 20060715 (prerelease) (Debian 4.1.1-9)] on linux2
MySQLdb 1st:
MySQLdb.__version__
1.2.1_p2
MySQLdb 2nd:
MySQLdb.__version__
1.2.1g2
> > Maybe dependent from the MySQL version?
>
> I believe it was more a problem of mysqldb and older versions of
> MySQL, yes, as you can see in this list archives. The problems
> didn't occur for other supported database servers.
Yes, there was also a thread in SQLAlchemy mailinglist, but I am not
sure, whether this is a problem of "double encoding" mentioned here:
http://groups.google.com/group/sqlalchemy/browse_thread/thread/333c7162cc41400e
And there is a corresponding entry at MySQLdb tracker:
http://sourceforge.net/tracker/index.php?func=detail&aid=1592353&group_id=22307&atid=374932
HTH.
Thanks,
Stefan
--
Start here: www.meretz.de
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---