InputStreamReader的中文乱码的问…

ServerSocket serverSocket = new ServerSocket(5432);
Socket client2 = serverSocket.accept();
String str="";
BufferedReader input = new BufferedReader(new InputStreamReader(client2.getInputStream(),"gb2312"));
String tempString ="";
        
 // 一次读入一行,直到读入null为文件结束
while ((tempString = input.readLine()) != null) 
{
str+=tempString+"\n";
}             
input.close();

你可能感兴趣的:(android)