Re: UNICODE

From: Marko Kreen <marko(at)l-t(dot)ee>
To: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: UNICODE
Date: 2001-10-28 10:53:55
Message-ID: 20011028125354.A13053@l-t.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-hackers

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

In response to

  • UNICODE at 2001-10-28 08:22:24 from Jean-Michel POURE

Responses

  • Re: UNICODE at 2001-10-28 11:44:26 from Jean-Michel POURE

Browse pgsql-admin by date

  From Date Subject
Next Message Jean-Michel POURE 2001-10-28 11:44:26 Re: UNICODE
Previous Message Jean-Michel POURE 2001-10-28 10:06:00 Re: UNICODE

Browse pgsql-general by date

  From Date Subject
Next Message Uros Gruber 2001-10-28 11:38:21 Problem with some function
Previous Message Jean-Michel POURE 2001-10-28 10:06:00 Re: UNICODE

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Michel POURE 2001-10-28 11:44:26 Re: UNICODE
Previous Message Jean-Michel POURE 2001-10-28 10:06:00 Re: UNICODE