Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'encoding': 0.05; 'string.': 0.05; 'subject:Python': 0.06; 'debugging': 0.07; 'utf-8': 0.07; 'created,': 0.09; 'encode': 0.09; 'python': 0.11; "'localhost',": 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'help...': 0.16; 'mode,': 0.16; 'statement.': 0.16; 'subject:issue': 0.16; 'wrote:': 0.18; 'header :User-Agent:1': 0.23; 'url:dev': 0.24; 'query': 0.26; 'right.': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'host': 0.29; 'character': 0.29; 'code': 0.31; 'problem': 0.35; 'subject: (': 0.35; 'created': 0.35; 'problem.': 0.35; 'but': 0.35; 'choosing': 0.36; 'should': 0.36; 'step': 0.37; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'rather': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'subject: ': 0.61; 'today.': 0.61; 'url:5': 0.61; 'first': 0.61; "you'll": 0.62; "you've": 0.63; 'url:0': 0.67; 'below.': 0.71; 'greek': 0.84 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Mon, 27 May 2013 08:42:56 -0600 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130105 Thunderbird/10.0.12 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Encodign issue in Python 3.3.1 (once again) References: <7823093c-2c07-4fa0-ae97-960c62f8ff9d@googlegroups.com> <69f5q8hkra42rvpfmbng4f0airgikqf5js@4ax.com> <9560d43f-8100-4914-9a71-c30ab479ec35@googlegroups.com> In-Reply-To: <9560d43f-8100-4914-9a71-c30ab479ec35@googlegroups.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369665785 news.xs4all.nl 15989 [2001:888:2000:d::a6]:44696 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46199 On 05/26/2013 11:06 PM, Νίκος Γκρ33κ wrote: > But iu have it set up for 'utf-8' as seen in this statement. > > con = pymysql.connect( db = 'metrites', host = 'localhost', user = > 'me', passwd = 'somepass', charset='utf-8', init_command='SET NAMES UTF8' ) That might not help... see below. > > Yoiu mean i shoudl chnag eit to greek isoo= (iso-8859-7) > but then i store english names and greek names as well, so it has to be a utf-8. Right. UTF-8 is the encoding you want. I think your problem is that when the MySQL database was created, it was not created using the UTF-8 mode, but rather latin-1 (despite your init_command which has nothing to do with database creation). You'll want to recreate the database and make double sure you've selected the right character set and collation: http://dev.mysql.com/doc/refman/5.0/en/charset-applications.html At least that should be your first step in debugging this problem. If the database is indeed utf-8, then you can move on to debugging why the python code is choosing latin-1 to encode your query string. That's my two-cents for today.