Re: Encoding trouble when script called from application

2014-01-14 Thread Peter Otten
Florian Lindner wrote: > Hello! > > I'm using python 3.2.3 on debian wheezy. My script is called from my mail > delivery agent (MDA) maildrop (like procmail) through it's xfilter > directive. > > Script works fine when used interactively, e.g. ./script.py < testmail but > when called from maildr

Encoding trouble when script called from application

2014-01-14 Thread Florian Lindner
Hello! I'm using python 3.2.3 on debian wheezy. My script is called from my mail delivery agent (MDA) maildrop (like procmail) through it's xfilter directive. Script works fine when used interactively, e.g. ./script.py < testmail but when called from maildrop it's producing an infamous UnicodeD

Re: Encoding trouble

2010-12-15 Thread Romaric DEFAUX
Le 15/12/2010 14:16, Benedict Verheyen a écrit : On 15/12/2010 12:34, Romaric DEFAUX wrote: To create these query, I do this : query = "UPDATE website SET client_name='%s' WHERE ip='%s'" % (self.client_name, self.ip) then self.cursor.execute(query) Unicode can be tricky. Don't you have to

Re: Encoding trouble

2010-12-15 Thread Benedict Verheyen
On 15/12/2010 12:34, Romaric DEFAUX wrote: > To create these query, I do this : > query = "UPDATE website SET client_name='%s' WHERE ip='%s'" % > (self.client_name, self.ip) > then self.cursor.execute(query) > Unicode can be tricky. Don't you have to encode the string again? I tested this in th

Encoding trouble

2010-12-15 Thread Romaric DEFAUX
Hi all, Since yesterday I'm working on an encoding problem, I become crazy now :) Could you please help me ? Here's the description of the problem : I've got two table in a MysqlDB : history_website and website The important column in them are : history_website.message (varchar(255), encoding