Received: from www.inreko.ee (www.inreko.ee [195.222.18.2]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9SArqP91572 for ; Sun, 28 Oct 2001 05:53:52 -0500 (EST) (envelope-from marko@l-t.ee) Received: from grue ([195.222.18.13] helo=grue.l-t.ee) by www.inreko.ee with esmtp (Exim 3.22 #1) id 15xnhv-0002os-00; Sun, 28 Oct 2001 13:02:23 +0200 Received: from marko by grue.l-t.ee with local (Exim 3.32 #1 (Debian)) id 15xnZj-0003eN-00; Sun, 28 Oct 2001 12:53:55 +0200 Date: Sun, 28 Oct 2001 12:53:55 +0200 From: Marko Kreen To: Jean-Michel POURE Cc: pgsql-hackers@postgresql.org Subject: Re: UNICODE Message-ID: <20011028125354.A13053@l-t.ee> References: <4.2.0.58.20011028085953.00cfa740@pop.freesurf.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4.2.0.58.20011028085953.00cfa740@pop.freesurf.fr> X-Archive-Number: 200110/980 X-Sequence-Number: 14703 On Sun, Oct 28, 2001 at 09:22:24AM +0100, Jean-Michel POURE wrote: > > I am running PostgreSQL 7.1.2 with UNICODE support in production. > Maybe I miss something about UNICODE: > > CREATE TABLE "test" ( > "source_oid" serial, > "source_timestamp" timestamp, > "source_creation" date DEFAULT 'now', > "source_modification" date DEFAULT 'now', > "source_content" text > ); > > INSERT INTO test (source_content) VALUES ('Photocopie du permis de > construire accepté.'); > > Now, when trying : > SELECT * FROM test WHERE source_content ILIKE '%accept%'; ---> returns the > record; > SELECT * FROM test WHERE source_content ILIKE '%accepté%' ---> returns > nothing > SELECT * FROM test WHERE source_content ILIKE '%accepte%' ---> returns > nothing > > The same happens from ODBC, PHP and psql. Can you reproduce this? Sorry, I misinterpreted what your problem is. I somehow thought you want the 'é' and 'e' produce same result - for that you need to mess with locale, but LIKE does not use locale anyway... Now I reread you message and here's hint: * If client_encoding == server_encoding, the bytes are put into DB as-is - no conversion is done. So are you abslutely sure you have on client side UTF8 strings? Unfortunately you cant use client_encoding=latin1 as PostgreSQL refuses the do the conversion between them. (I am with 7.1.3) Eg. I did the following: * created db with encoding = UNICODE * Put your example into test.sql * iconv -f latin1 -t utf8 test.sql > test2.sql * psql < test2.sql and it worked as it should... -- marko