jbuilder编码格式与polish打包问题
我做了一个j2me的网络应用客户端,在wtk的模拟器上运行都可以正确得显示中文。但是在jbuilder2005中用polish打包后安装到nokia N95上的时候,从网络接收回来的数据显示“?”其他在本地写入的中文都可以正常显示。下面是我接收网络数据的代码:(服务器也是用utf-8的格式来构造的字节流,然后发送过来的。)
dis = new DataInputStream(hpc.openInputStream());
int character;
int charCount = 0;
// 读取返回的HTTP内容
byte[] strByte = new byte[dis.available()];
while((character = dis.read()) != -1){
strByte[charCount] = (byte)character;
charCount++;
}
utf8Togb2312(strByte);
/**
* 处理编码转换
* */
private String utf8Togb2312(byte[] strb){
String res=null;
try{
res= new String(strb,"UTF-8");
}
catch(Exception e){
e.printStackTrace();
res = "<q><o>false<o></q>";
}
return res;
}
请问各位大虾,有没有人知道这是怎么回事?我jbuilder用的源码编码环境是默认的GBK编码格式。是不是和这个有关?