Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id B54F59F9F47 for ; Sun, 24 Dec 2006 12:57:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 61683-05 for ; Sun, 24 Dec 2006 12:57:49 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 7D4D19F9F46 for ; Sun, 24 Dec 2006 12:57:49 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.8/8.13.8) with ESMTP id kBOGvZOn044813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 24 Dec 2006 09:57:37 -0700 (MST) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.8/8.13.8) with ESMTP id kBOGvYkk044234; Sun, 24 Dec 2006 09:57:34 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.8/8.13.8/Submit) id kBOGvYhs044233; Sun, 24 Dec 2006 09:57:34 -0700 (MST) (envelope-from mfuhr) Date: Sun, 24 Dec 2006 09:57:34 -0700 From: Michael Fuhr To: Alexis Paul Bertolini Cc: pgsql-sql@postgresql.org Subject: Re: Changing character set when the damage is done Message-ID: <20061224165734.GA43931@winnie.fuhr.org> References: <458C6650.80105@computer.org> <1166831523.6369.308.camel@localhost.localdomain> <458EA551.3090008@computer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <458EA551.3090008@computer.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/166 X-Sequence-Number: 27122 On Sun, Dec 24, 2006 at 05:05:37PM +0100, Alexis Paul Bertolini wrote: > They show up in PHP, PgAdminIII and psql. All the same. A lowercase e > with a grave accent appears as a capital A with the cedilla, followed by > an umlaut (just the umlaut, on its own). So to answer your question, > they are two characters. Are you sure that's not a tilde (a wavy line above the A) instead of a cedilla (a hook below the A)? The UTF-8 encoding for lowercase e with grave is 0xc3 0xa8, which in ISO-8859-1 (LATIN1) or Windows-1252 is uppercase A with tilde followed by a diaeresis (an umlaut on its own). Does the data appear correctly if you do either of the following? SELECT convert(colname, 'utf8', 'latin1') FROM tablename; SELECT convert(colname, 'utf8', 'win1252') FROM tablename; If you use characters like "smart quotes" or the Euro sign then you'll probably need to use win1252 instead of latin1. Does the following show a Euro sign or does it show blank? SELECT convert('\342\202\254', 'utf8', 'win1252'); -- Michael Fuhr