请问高手们一个问题!关于上传文件的一个问题!! 是呀,我也想知道,怎么解决呀~~~~~~~~~~~~~~~~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1.進行字符的轉換.要寫函數.一般第一個函數TranStrType就可以了.但有時用其他函數多試幾次<%!public String TranStrType(String str) throws Exception{ byte[] _tempByte=str.getBytes("ISO8859-1"); String _tempStr=new String(_tempByte); return _tempStr;}public static String ISOtoGBK(String strvalue) { try{ if(strvalue==null) return null; else { strvalue = new String(strvalue.getBytes("ISO8859-1"),"GBK"); return strvalue; } }catch(Exception e){ return null; } } public static String ISOtoGB2312(String strvalue) { try{ if(strvalue==null) return null; else { strvalue = new String(strvalue.getBytes("ISO8859-1"),"gb2312"); return strvalue; } }catch(Exception e){ return null; } }public static String ISOtoBIG5(String strvalue) { try{ if(strvalue==null) return null; else { strvalue = new String(strvalue.getBytes("ISO8859-1"),"big5"); return strvalue; } }catch(Exception e){ return null; } } public static String Gb2312toISO(String strvalue) { try{ if(strvalue==null) return null; else { strvalue = new String(strvalue.getBytes("gb2312"), "ISO8859-1"); return strvalue; } }catch(Exception e){ return null; } } public static String GBKtoISO(String strvalue) { try{ if(strvalue==null) return null; else { strvalue = new String(strvalue.getBytes("gbk"), "ISO8859-1"); return strvalue; } }catch(Exception e){ return null; } }public static String GIG5toISO(String strvalue) { try{ if(strvalue==null) return null; else { strvalue = new String(strvalue.getBytes("big5"), "ISO8859-1"); return strvalue; } }catch(Exception e){ return null; } }%>2.用Tomcat4.0.這個版本的Tomcat再直接連接中文名的文件不會出現找不到文件的情況.而4.1則不行4.在JSP文件第一行加<%@ page contentType="text/html;charset=big5"%>(繁體 )<%@ page contentType="text/html;charset=gb2312"%>(簡體 )5.在html的head中加入<meta http-equiv="Content-Type" content="text/html; charset=big5">(繁體 )<meta http-equiv="Content-Type" content="text/html; charset=gb2313">簡體 ) 我的网站每运行一天就自动的出500错误不能访问,请高手进来指点 jxl操作excel? spring与struts无法关联 java web问题。 JSP数据库表格操作 网页无法显示完整,刷新一次又正常,怎么回事呢? Java 用什麽類可以生成 “ASDFE-21324-DSSDF-SDS23DS” 類似序列號形式的 UUID ? IE看不了applet图片. 求java强人编写一段代码(100分求助) 新手求助 一个突然出现的问题 谁有做好的论坛?给一份代码我学习下好吗?高分相送. servlet 怎样输出图片
<%!
public String TranStrType(String str) throws Exception
{
byte[] _tempByte=str.getBytes("ISO8859-1");
String _tempStr=new String(_tempByte);
return _tempStr;
}public static String ISOtoGBK(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("ISO8859-1"),"GBK");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String ISOtoGB2312(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("ISO8859-1"),"gb2312");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String ISOtoBIG5(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("ISO8859-1"),"big5");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String Gb2312toISO(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("gb2312"), "ISO8859-1");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String GBKtoISO(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("gbk"), "ISO8859-1");
return strvalue;
}
}catch(Exception e){
return null;
}
}
public static String GIG5toISO(String strvalue)
{
try{
if(strvalue==null)
return null;
else
{
strvalue = new String(strvalue.getBytes("big5"), "ISO8859-1");
return strvalue;
}
}catch(Exception e){
return null;
}
}
%>
2.用Tomcat4.0.
這個版本的Tomcat再直接連接中文名的文件不會出現找不到文件的情況.而4.1則不行4.在JSP文件第一行加
<%@ page contentType="text/html;charset=big5"%>(繁體 )
<%@ page contentType="text/html;charset=gb2312"%>(簡體 )5.在html的head中加入
<meta http-equiv="Content-Type" content="text/html; charset=big5">(繁體 )
<meta http-equiv="Content-Type" content="text/html; charset=gb2313">簡體 )