From: Marko Kreen <marko@l-t.ee>
To: Jean-Michel POURE <jm.poure@freesurf.fr>
Cc: pgsql-hackers@postgresql.org
Subject: Re: UNICODE
Date: Sun, 28 Oct 2001 14:05:47 +0200
Message-ID: <20011028140547.A15516@l-t.ee> (raw)
In-Reply-To: <4.2.0.58.20011028121057.00d1a100@pop.freesurf.fr>
References: <4.2.0.58.20011028085953.00cfa740@pop.freesurf.fr>
<4.2.0.58.20011028085953.00cfa740@pop.freesurf.fr>
<4.2.0.58.20011028121057.00d1a100@pop.freesurf.fr>
On Sun, Oct 28, 2001 at 12:44:26PM +0100, Jean-Michel POURE wrote:
> I only want this query to work under Unicode:
> SELECT * FROM test WHERE source_content ILIKE '%accepté%'.
As I showed it works, if data in db is in UTF-8 and the query
string 'accepté' is in UTF8
> >* If client_encoding == server_encoding, the bytes are put into
> > DB as-is - no conversion is done.
> >
> >So are you absolutely sure you have on client side UTF8 strings?
> PostgreSQL is compiled with UNICODE and LOCALE support.
> Unicode is used on both ends (PostgreSQL and psql).
psql uses your input literally - so is your console/xterm in
UNICODE/UTF8?
> >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...
>
> Nice to hear it works when transcoding files to UTF-8. It shows it is not a
> back-end problem.
>
> As for me, I typed INSERT INTO source_content VALUES ('Permis de conduire
> accepté') in Psql.
As I said - psql does not do any conversion.
> Psql does not insert the data and I have to kill it manually. Can you
> reproduce this?
No. If it hangs this is serious problem. Or did you simply
forgot final ';' ? It btw does not seem valid sql to me,
considering you previously provided table structure.
In the end: are the strings/queries you give to psql/pg_exec
UTF-8 - this is now main thing, as you have _configured_
everything correctly.
--
marko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: marko@l-t.ee, jm.poure@freesurf.fr, pgsql-hackers@postgresql.org
Subject: Re: UNICODE
In-Reply-To: <20011028140547.A15516@l-t.ee>
References: <4.2.0.58.20011028085953.00cfa740@pop.freesurf.fr> <4.2.0.58.20011028121057.00d1a100@pop.freesurf.fr> <20011028140547.A15516@l-t.ee>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox