手机显示乱码问题,高分

popgang 2003-04-01 09:17:11
http=(HttpConnection)Connector.open(url) ;
http.setRequestMethod(HttpConnection.GET);
is=http.openInputStream() ;
int length=(int)http.getLength() ;
byte date[]= new byte[length];
is.read(date);
receiveStr=new String(date);
我把receiveStr得到的字符串拆分显示,在jbuilder7+mobileset3显示正常,但是在我的摩托的a6288显示是乱码,怎么回事啊,服务器端我用的是asp用respose.write的
...全文
52 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangch1234 2003-04-01
  • 打赏
  • 举报
回复
可能是编码的问题,试试

try {
hc = (HttpConnection)Connector.open(url);
in = hc.openInputStream();

int contentLength = (int)hc.getLength();
byte[] raw = new byte[contentLength];
int length = in.read(raw);

in.close();
hc.close();

// Show the response to the user.
String s = new String(raw, "GB2312");
mMessageItem.setText(s);
}
catch (IOException ioe) {
mMessageItem.setText(ioe.toString())
bnfan 2003-04-01
  • 打赏
  • 举报
回复
不要也别忘了给分阿!
bnfan 2003-04-01
  • 打赏
  • 举报
回复
乱码是个普遍的问题,你可以用
inputSreamReader试试,moto的人说这样可以,但我没成功!
另外我有些资料你要可以给你,不过,嘿嘿....
分数....?

13,100

社区成员

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

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