求UCS2转换成GBK的方法,使汉字能正常显示。

MRelephant 2003-04-02 09:43:37
谢谢
...全文
124 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
MRelephant 2003-04-02
  • 打赏
  • 举报
回复
不可以
数据库是oracle从数据库选出。
redapple111 2003-04-02
  • 打赏
  • 举报
回复
1.<%@ page contentType="text/html;charset=GBK"%>
2.String temp=new String(temp_t.getBytes("GBK"));
这样在页面就可以显示了。
isub 2003-04-02
  • 打赏
  • 举报
回复
我刚学,不知道你要的是不是这个。
<%@ page contentType="text/html;charset=gb2312"%>
<%!
public String getStr(String str){
try{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e){
}
return "null";
}
%>
MRelephant 2003-04-02
  • 打赏
  • 举报
回复
怎么没人帮我呀

81,122

社区成员

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

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