Re: Unicode!

From: Chen Shaopeng <chen_shaopeng(at)idsignet(dot)com>
To: star star <hoatamet(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Unicode!
Date: 2005-03-16 07:52:04
Message-ID: 1110959524.2021.13.camel@cerberus.idsignet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Since you used Java JDBC to insert the data into PostgreSQL,
can you also JDBC to pull it out back and see if you get
the right data back? If not, then your database encoding
is probably the error. You need to set the DB encoding
properly.

If you can get your data back to the correct encoding,
then check the environment settings of your pgadmin III.
I don't quite remember which version of pgadmin always
gave me that problem too when I used it in chinese
environment. My data in the DB is correct, and I can
get it back in the right encoding, but pgadmin just does
not display correctly, even though other applications
running in the same environment settings can display
unicode correctly.

Not sure if you are running Linux or Windows. If you run
Linux, you can set your environments to UTF-8, then connect
to the DB with psql, and display the contents of your data.
If your data are in unicode, you should see the display
correctly.

csp

在 2005-03-10四的 17:20 -0800,star star写道:
> I use PostgreSQL 8!
>
> I have 2 file:
>
> insert.htm
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> </head>
> <body>
> <form name="form1" method="post" action="postgre_insert.jsp" >
> <input type="text" name="username">
> <input type="submit" name="Submit" value="Submit">
> </form>
> </body>
> </html>
>
> postgre_insert.jsp
> <%@ page contentType="text/html; charset=utf-8" import="java.sql.*"
> errorPage="" %>
> <%
> String username=request.getParameter("username");
> String str="insert into user_table values('"+username+"','try')";
> Class.forName("org.postgresql.Driver");
> String url = "jdbc:postgresql://localhost:5432/try";
> Connection conn = DriverManager.getConnection(url, "postgres",
> "pass");
> PreparedStatement s = conn.prepareStatement(str);
> s.executeUpdate();
> out.println("OK");
> %>
> I input "Tiếng Việt" on textfield and click Submit button. Insertion
> is successed.
> But, when i view data in pgAdmin III(version 1.2.0), data is " Ting
> Vi‡t ".
> Can you help me!?
>

--
陈少鹏 Chen Shaopeng
上海龙方信息技术有限公司
http://www.idsignet.com

In response to

  • Unicode! at 2005-03-11 01:20:12 from star star

Browse pgsql-admin by date

  From Date Subject
Next Message Dr. Roger Wiener 2005-03-16 12:07:16 Migration from 7.1.3. to 7.4.7.
Previous Message Tom Lane 2005-03-16 07:27:48 Re: Vacuum questions