- 论坛徽章:
- 0
|
请帮我看看这个,为什么还是不能显示中文
InputStream in;
OutputStream output;
Socket s;
int c;
StringBuffer strBuf = new StringBuffer();
String str = domain+"\r\n";
try{
s = new Socket("whois.internic.net",43,true);
s.setSoTimeout(30000);
in = s.getInputStream();
output = s.getOutputStream();
output.write(str.getBytes());
while((c=in.read())>;=0)
{
strBuf.append((char) c);
}
detail = new String(strBuf);
detail = new String(detail.getBytes("ISO8859_1","gb2312"
in.close();
output.close();
s.close();
}
}catch (SocketException sEx)
{
}catch (IOException ex){
} |
|