On Oct 20, 2:13 pm, sophie_newbie <[EMAIL PROTECTED]> wrote:
> Hi, I want to store python text strings that characters like "é" "Č"
> in a mysql varchar text field. Now my problem is that mysql does not
> seem to accept these characters. I'm wondering if there is any way I
> can somehow "encode" these characters to appear as normal characters
> and then "decode" them when I want to get them out of the database
> again?

Use unicode strings, and use the 'encode' and 'decode' methods. Mysql
has utf8 support for varchars, so that seems a likely encoding to use.
If you're stuck with ascii, you can use 'unicode_escape' if you're
only accessing it from python.

But first read this excellent article on 'funny' characters:
http://www.joelonsoftware.com/articles/Unicode.html

--
Paul Hankin

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to