这种“错误”在vc2008(也是unicode)里是支持的,如:strncmp("涓嬩竴椤", ptr)结果为0,只是转到java后,不知怎样写?

解决方案 »

  1.   

    strncmp不可靠啊,要用_tcscmp 这些安全字符串,同时java支持utf-8的啊,你处理的错误在于BufferedReader(new InputStreamReader(mSocket.getInputStream()));
    这句,没有加入charset设置编码类型,设置成utf-8就不用,乱码表示了,直接写 ,下一页
      

  2.   

    InputStreamReader(InputStream in, Charset charset)  有这种,重载版本
      

  3.   

    试了:
    in = new BufferedReader(new InputStreamReader(mSocket.getInputStream(), "GB2312"));
    content.substring(j + 2, j + 6).equals("涓嬩竴椤"))为true另又试:
    in = new BufferedReader(new InputStreamReader(mSocket.getInputStream());
    content.substring(j + 2, j + 5).equals("下一页")为trueok了