<%@page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*" %>
<%!
public String ex_chinese(String str){
if(str==""){
str ="null" ;
}
else{
try {
str = new String(str.getBytes("iso-8859-1"),"gb2312") ;
}
catch (Exception ex) {
}
}
return str ;
}
%> 字段名=ex_chinese(字段名);
我用过了,可以
<%@page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*" %>
<%!
public String ex_chinese(String str){
if(str==""){
str ="null" ;
}
else{
try {
str = new String(str.getBytes("iso-8859-1"),"gb2312") ;
}
catch (Exception ex) {
}
}
return str ;
}
%> 字段名=ex_chinese(字段名);
我用过了,可以
<%@page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*" %>
<%!
public String ex_chinese(String str){
if(str==""){
str ="null" ;
}
else{
try {
str = new String(str.getBytes("iso-8859-1"),"gb2312") ;
}
catch (Exception ex) {
}
}
return str ;
}
%> 字段名=ex_chinese(字段名);
我用过了,可以
<%@ page import="java.sql.*" %>
<%!
public String ex_chinese(String str){
if(str==""){
str ="null" ;
}
else{
try {
str = new String(str.getBytes("iso-8859-1"),"gb2312") ;
}
catch (Exception ex) {
}
}
return str ;
}
%> 字段名=ex_chinese(字段名);
我用过了,可以
<%@page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*" %>
<%!
public String ex_chinese(String str){
if(str==""){
str ="null" ;
}
else{
try {
str = new String(str.getBytes("iso-8859-1"),"gb2312") ;
}
catch (Exception ex) {
}
}
return str ;
}
%> 字段名=ex_chinese(字段名);
我用过了,可以
<%@page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*" %>
<%!
public String ex_chinese(String str){
if(str==""){
str ="null" ;
}
else{
try {
str = new String(str.getBytes("iso-8859-1"),"gb2312") ;
}
catch (Exception ex) {
}
}
return str ;
}
%> 字段名=ex_chinese(字段名);
我用过了,可以
String str = new String(request.getParameter("str").getBytes("iso-8859-1"), "GB2312");
Sring str = "";
if (request.getParameter("str") != null)
str = new String(request.getParameter("str").getBytes("iso-8859-1"), "GB2312");