First, I would try to set encoding (charset) for the insert.htm page to
UTF-8. That might help. If not, let us know.
Miroslav Åulc
star star wrote:
I use PostgreSQL 8!
I have 2 file:
insert.htm
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; ">
</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 " TiÃÂÂng
ViÃÂât ".
Can you help me!?
------------------------------------------------------------------------
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
<http://us.rd.yahoo.com/evt=31637/*http://smallbusiness.yahoo.com/resources/>
begin:vcard
fn;quoted-printable:Miroslav =C5=A0ulc
n;quoted-printable:=C5=A0ulc;Miroslav
org:StartNet s.r.o.
adr;quoted-printable;quoted-printable:;;Vrchlick=C3=A9ho 161/5;Praha 5;;150 00;=C4=8Cesk=C3=A1 republika
email;internet:[EMAIL PROTECTED]
title:CEO
tel;work:+420 257 225 602
tel;cell:+420 603 711 413
x-mozilla-html:TRUE
url:http://www.startnet.cz
version:2.1
end:vcard
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster