String header1=new String(header.getBytes("iso-8859-1"),"GB2312");

解决方案 »

  1.   

    header.getBytes()
    你用上面把中文(一个中文是2个byte)转成一个byte数组,这可能是出错的原因.我没运行过,只是按我经验想的.
      

  2.   

    String header1=new String(header.getBytes("GB2312","iso-8859-1");
    这样header可以用中文显示
    但是属性的键值的中文coding方法不一样,解决不了,,:(
      

  3.   

    head按楼上的可以显示中文
    至于文件里面的value和key恐怕不能显示中文了,
    jdk API docs里的progperties.store()中说的:
    Characters less than \u0020 and characters greater than \u007E are written as \uxxxx for the appropriate hexadecimal value xxxx. 详情请参看jdk API docs
      

  4.   

    补充一下,store()里文件中的key和value中文用\uxxxx表示,但用properties.load()可以正确取出中文
      

  5.   

    据一个同事讲,他说他研究过jdk代码,propperties文件不能显示中文,除非修改src文件,我没测试过,仅供参考。你也可以去看看源代码,看是怎么处理的