I struggled with this for quite some time, particularly with a set of
data which was imported into mysql 5 from a mysql 3.23. db which was
storing UTF-8 in latin1 tables. Exentually I found that the solution
was in the connection URI, which I have as:

sqlalchemy.dburi = mysql://user:[EMAIL 
PROTECTED]:3306/dbname?use_unicode=1&charset=utf8

Once I figured out those variables it all works a treat. I store the
data in my tables as utf8_unicode_ci

All the best,

BJPirt



andyprog wrote:
> Hi all,
>
> (I'm using Pylons for the first time, so pls bear with me...)
>
> I'm setting up a Pylons app with Mako + SQLAlchemy + MySQL + UTF-8
> support
> -- but I've had trouble finding one place with clear instructions on
> how to do this,
> so I've gathered pieces of info from here and there, but this, coupled
> with the fact
> that some instructions are outdated, and others not so clear, has left
> me quite confused... :(
>
> For now, I'll ask the following questions, in the hopes that someone
> may help me:
>
> - In "http://docs.pythonweb.org/display/pylonsdocs/
> Internationalization,+Localization+and+Unicode#databases",
> it says:
> ----
> If you're using MySQL together with SQLAlchemy, see the following, as
> there are some bugs in MySQLdb that you'll need to work around:
>
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg00366.html
> ----
>
> Does this still apply for the latest versions of SQLAlchemy and
> MySQLdb (v1.2.2) ?
>
>
> - In "http://pylonshq.com/docs/0.9.5/internationalization.html";, it
> says:
> "[...] you need to consider both the encoding of the database and the
> encoding used by the database driver."
>
> How do I set this up for MySQL (to be used with SQLAlchemy)?
>
>
> - And, BTW, which MySQL version is preferred?
>
> I ask this, mainly because MySQLdb's changelog says:
> ----
>   * MySQL-4.1 is supported and tested. The prepared statements API is
> not
>     supported, and won't be until MySQLdb-1.3 or 2.0.
>
>   * MySQL-5.0 is supported and tested, including stored procedures.
> ----
>
> So is MySQL-5.0 the best option?
>
>
> Thanks in advance!
>
> -Andy P.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to