Re: Inserting Unicode into Postgre

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: Inserting Unicode into Postgre
Дата
Msg-id 20010417161538B.t-ishii@sra.co.jp
обсуждение исходный текст
Ответ на Inserting Unicode into Postgre  ("Firestar" <theebh@yahoo.com>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Anand Raman
Дата:
Сообщение: Re: Cursors in plpgsql
Следующее
От: "Oliver Elphick"
Дата:
Сообщение: Re: join queries