JSP技術:
----------------------------------------
public class ISOtoGb2312
{
public static String convert( String str )
{
try
{
byte<> bytesStr=str.getBytes( "ISO-8859-1" ) ;
return new String( bytesStr, "gb2312" ) ;
}
catch( Exception ex)
{
return str ;
}
}
}
-------------------------------------------------------------------
<%@ page contentType="text/html; charset=GB2312" %>
<html>
<head>
<title>
輸入數據
</title>
</head>
<body bgcolor="#ffffff">
<h1>
請輸入數據:
</h1>
<hr>
<form method="POST" action="insert.jsp">
<!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.txt"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p> </p>
<p> </p>
<p><img border="0" src="img/cisco.gif" width="70" height="81">
<font size="5" color="#0000FF"><b>學 號:
</b></font><input type="text" name="id" size="25"> <img border="0" src="img/cisco.gif" width="70" height="81">
<font size="5" color="#0000FF"><b>性 別</b></font><font size="5" color="#0000FF"><b>:
</b></font><input type="text" name="sex" size="24"></p>
<p><img border="0" src="img/cisco.gif" width="70" height="81">
<font size="5" color="#000080"><b>姓 名:
</b></font><input type="text" name="name" size="25"> <img border="0" src="img/cisco.gif" width="70" height="81">