Re: Inserting Unicode into Postgre

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: theebh(at)yahoo(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Inserting Unicode into Postgre
Date: 2001-04-17 07:15:38
Message-ID: 20010417161538B.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I'm currently using PostgreSQL 7.0 on Solaris. My Java program receives
> strings in Big5
> encoding and will store them in PostgreSQL (via JDBC). However, the inserted
> strings become
> multiple '?' (question marks) instead everytime i do a insert command. And
> when i retrieve them,
> via JDBC, the string becomes those question marks.
>
> Is the problem due to the Unicode encoding that Java String uses, or must i
> enable multibyte-support
> in my postgre installation? If i enable multibyte support, should i create
> my table with Unicode support,
> or Big5?

First of all, you cannot store Big5 data into PostgreSQL. You need to
convert Big5 to either EUC_TW or UTF-8 before storing them into
PostgreSQL database. There are several ways to accompish this.

The easiest way would be upgrade to 7.1 with multibyte support enabled
and create a database with UNICODE (actially UTF-8) or EUC_TW
encoding. In this environment, 7.1's JDBC driver would recognize the
database encoding correctly, and do an automatic conversion between
database encodings and UTF-8, that is Java's internal encoding.

Ask Java expers on this list for more details.
--
Tatsuo Ishii

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christian Fritze 2001-04-17 07:16:25 Re: index not used with subselect in where clause ?
Previous Message Oliver Elphick 2001-04-17 06:40:03 Re: Schema Import