Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write Big5 Chinese into Postgresql

Status
Not open for further replies.

neltan

Programmer
Nov 4, 2002
82
AU
Since database has to interface with legacy system which store Chinese in "Big5", my webapp must also store in "Big5".

I'm using postgresql 7.3.
I did not change the encoding. I used "createdb dbname" since other command like "createdb -E EUC_TW dbname" will reject my insert statement because the field may contain both Chinese and English.

Here are some setting I used:
servlet:
- request.setCharacterEncoding("BIG5");
- rs.setString(1, name); //name = "³¯®¦¼Ö"
- insert into table1 (name) values ('³¯®¦¼Ö'); // ok
- jsp read the field
java.lang.String(rs.getBytes(col_name),"BIG5");
but it display "? ³æ ?"

However, when I copy the insert statement and paste in "putty", correct when insert and display ?!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top