Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #64895 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2014-01-28 19:35 +1100 |
| Last post | 2014-01-28 19:35 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Enable unicode Chris Angelico <rosuav@gmail.com> - 2014-01-28 19:35 +1100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-01-28 19:35 +1100 |
| Subject | Re: Enable unicode |
| Message-ID | <mailman.6059.1390898159.18130.python-list@python.org> |
On Tue, Jan 28, 2014 at 7:26 PM, Igor Korot <ikorot01@gmail.com> wrote: > Hi, ALL, > In here: http://stackoverflow.com/questions/21397035/set-utf8-on-mysql, > I got a suggestion to enable "use_unicode". > Problem is I'm developing on Windows and it's not that I can recompile > my python. > I'm using Python2.7 on Windows XP. > > Any pointer on how do I enable "use_unicode"? Before you go any further: MySQL has a broken interpretation of "utf8" that allows only a subset of the full Unicode range. Instead, use "utf8mb4", which is what the rest of the world calls UTF-8. As far as I know, you can just switch in utf8mb4 everywhere that you're currently using utf8 and it'll work. According to [1] the use_unicode flag is a keyword parameter to connect(). As much as possible, I'd recommend using those parameters rather than explicitly executing SQL statements to reconfigure the connection - it's clearer, and the local client might want to reconfigure itself in response to the change too. Be aware that MySQL has a number of issues with Unicode and sorting (or at least, it did the last time I checked, which was a while ago now), not to mention other problems with its default MyISAM format. You may want to consider PostgreSQL instead. ChrisA [1] http://mysql-python.sourceforge.net/MySQLdb.html
Back to top | Article view | comp.lang.python
csiph-web