store and retrieve 2 bytes charactors

From: Kathy Zhu <Kathy(dot)Zhu(at)Sun(dot)COM>
To: pgsql-general(at)postgresql(dot)org
Subject: store and retrieve 2 bytes charactors
Date: 2003-04-17 21:17:58
Message-ID: 200304172118.h3HLIIN16636@amon.Central.Sun.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,

I have a problem of storing and retrieving jp chars.

I have installed 7.2.1 with multibyte enabled.

The server encoding is SQL_ASCII.
The database jpdb's encoding is EUC_JP.

I have a test file that reads values (origVal) from Localization_jp.properties,
store them into db and retrieve them (as dbVal).

The value I tried is . It means "explanation" in English, which is 2 chars in
Japanese.

(String) origVal.length = 2;
(String) dbVal.length = 2;

but
origVal.equals(dbVal) = false.

I don't know what I need to do in order to be able to store and retrieve the
same string back.

What is missing ??
What are the minimal steps needed to store 2 bytes.

thanks!!
kathy

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-04-17 21:18:49 Re: Strange query optimization in 7.3.2
Previous Message Tom Lane 2003-04-17 21:13:24 Re: How foreign key info is stored