Re: 'ascii' codec can't encode character u'\u2013'

2005-09-30 Thread John J. Lee
deelan <[EMAIL PROTECTED]> writes: [...] > query = "UPDATE blogs_news SET text = %s WHERE id=%s" > cursor.execute(query, (text_extrated, id)) > > so mysqldb will take care to quote text_extrated automatically. this > may not not your problem, but it's considered "good style" when dealing > with db

Re: 'ascii' codec can't encode character u'\u2013'

2005-09-30 Thread thomas Armstrong
Hi. Thank you both for your answers. Finally I changed my MySQL table to UTF-8 and changed the structure of the query (with '%s'). It works. Thank you very much. 2005/9/30, deelan <[EMAIL PROTECTED]>: > thomas Armstrong wrote: > (...) > > when trying to execute a MySQL query: > > > > query

Re: 'ascii' codec can't encode character u'\u2013'

2005-09-30 Thread deelan
thomas Armstrong wrote: (...) > when trying to execute a MySQL query: > > query = "UPDATE blogs_news SET text = '" + text_extrated + "'WHERE > id='" + id + "'" > cursor.execute (query) #<--- error line > well, to start it's not the best way to do an update, try this instead: query = "U

Re: 'ascii' codec can't encode character u'\u2013'

2005-09-30 Thread Fredrik Lundh
Thomas Armstrong wrote: > I'm trying to parse a UTF-8 document with special characters like > acute-accent vowels: > > > ... > --- > > But I get this error message: > --- > UnicodeEncodeError: 'ascii' codec can't encode character

'ascii' codec can't encode character u'\u2013'

2005-09-30 Thread thomas Armstrong
Hi Using Python 2.3.4 + Feedparser 3.3 (a library to parse XML documents) I'm trying to parse a UTF-8 document with special characters like acute-accent vowels: ... --- But I get this error message: --- UnicodeEncodeError: 'ascii' codec can't encode ch