我使用jbuilder6.0来开发jsp,出现乱码怎么办????急急急!

fogwater 2002-03-28 05:45:34
我使用jbuilder6.0来开发jsp,出现乱码怎么办????急急急!那位大虾帮帮忙
...全文
27 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
weidegong 2002-03-28
  • 打赏
  • 举报
回复
//进行编码的转换---------------------------------------------
public String toGb(String uniStr){
String gbStr = "";
if(uniStr == null){
uniStr = "";
}
try{
byte[] tempByte = uniStr.getBytes("ISO8859_1");
gbStr = new String(tempByte,"GB2312");
}catch(UnsupportedEncodingException uef){
}
return gbStr;
}
public String toUni(String gbStr){
String uniStr = "";
if(gbStr == null){
gbStr = "";
}
try{
byte[] tempByte = gbStr.getBytes("GB2312");
uniStr = new String(tempByte,"ISO8859_1");
}catch(UnsupportedEncodingException uef){
}
return uniStr;
}
leonzhao 2002-03-28
  • 打赏
  • 举报
回复
将问题叙述详细!

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧