Thread: Unicode problems.

Unicode problems.

From
Joel SEGUILLON
Date:
    Hi all,
  I'm trying to use the jdbc driver for postgresql to insert unicode
values in my database.

  I've got a table : test(test_field varchar(50)).
  I'm trying to insert and compare unicode string in this test_field,
but if I insert two different values ("\u2293", "\u2256") with a
PreparedStatement and a setString, the backend does not seem to make a
difference beetween those two values. If I try a Select from test where
test_field = ? and a setString(1, "\u2256") my result set gives me two
lines.

  Could someone please help me ?

  I compiled postgres with blcksz=32768 and the
--enable-multibyte=UNICODE option. \encoding returns me UNICODE
  I connect to the server whith jdbc7.0_1.2 (found at
jdbc.postgresql.org).
  I use the property charSet=utf-8 when making the connection
(info.put("charSet", "utf-8"); Driver.getConnection(db, info);)

Thanks.

Joel Seguillon.

Re: Unicode problems.

From
"Dave Cramer"
Date:
Joel,

What happens when you do the select in psql ?

Dave
----- Original Message -----
From: "Joel SEGUILLON" <Joel.Seguillon@Uhb.Fr>
To: "PostgreSQL jdbc list" <pgsql-jdbc@postgresql.org>
Sent: Wednesday, May 23, 2001 7:05 AM
Subject: [JDBC] Unicode problems.


>     Hi all,
>   I'm trying to use the jdbc driver for postgresql to insert unicode
> values in my database.
>
>   I've got a table : test(test_field varchar(50)).
>   I'm trying to insert and compare unicode string in this test_field,
> but if I insert two different values ("\u2293", "\u2256") with a
> PreparedStatement and a setString, the backend does not seem to make a
> difference beetween those two values. If I try a Select from test where
> test_field = ? and a setString(1, "\u2256") my result set gives me two
> lines.
>
>   Could someone please help me ?
>
>   I compiled postgres with blcksz=32768 and the
> --enable-multibyte=UNICODE option. \encoding returns me UNICODE
>   I connect to the server whith jdbc7.0_1.2 (found at
> jdbc.postgresql.org).
>   I use the property charSet=utf-8 when making the connection
> (info.put("charSet", "utf-8"); Driver.getConnection(db, info);)
>
> Thanks.
>
> Joel Seguillon.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>


Re: Unicode problems.

From
Joel SEGUILLON
Date:
  Dave,
  When I try to select in psql it shows me some "?". (I use it on a
Linux console which can't represent those caracters i think).


Dave Cramer wrote:
>
> Joel,
>
> What happens when you do the select in psql ?
>
> Dave

Re: Unicode problems.

From
Tony Grant
Date:
On 23 May 2001 14:29:47 +0200, Joel SEGUILLON wrote:

>   When I try to select in psql it shows me some "?". (I use it on a
> Linux console which can't represent those caracters i think).

Joel http://www.animaproductions.com/ultra_fr.html

Lisez l'encadré jaune.

Cheers

Tony Grant

--
RedHat Linux on Sony Vaio C1XD/S
http://www.animaproductions.com/linux2.html
Macromedia UltraDev with PostgreSQL
http://www.animaproductions.com/ultra.html


Re: Unicode problems.

From
Joel SEGUILLON
Date:
    Tony,
  Je ne suis pas sur que cela resolve mon probleme. --enable-locale
n'est utile que pour visualiser les caracteres. Mon probleme principal
restera le meme, non ?

> Joel http://www.animaproductions.com/ultra_fr.html
>
> Lisez l'encadré jaune.

Re: Unicode problems.

From
Tony Grant
Date:
On 23 May 2001 15:06:47 +0200, Joel SEGUILLON wrote:

>   Je ne suis pas sur que cela resolve mon probleme. --enable-locale
> n'est utile que pour visualiser les caracteres. Mon probleme principal
> restera le meme, non ?

J'utilise un RedHat anglais sans locale=FR et ça marche

st_nazaire=# select * from questionnaire;

Retourne bien  ...informations sur la politique de la ville par rapport
à l'écologie

Je me suis battu avec ce truc et la sollution etait ca. multibyte et
locale. Perl ne semble pas avoir de problemes

A+

Tony

--
RedHat Linux on Sony Vaio C1XD/S
http://www.animaproductions.com/linux2.html
Macromedia UltraDev with PostgreSQL
http://www.animaproductions.com/ultra.html