`
gstarwd
  • 浏览: 1495339 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

解决RandomAccessFile写入文件乱码的办法

阅读更多
  out.writeBytes(  "  \r\n  "  );
mess  =   " 写入文件 " ;
byte  buffer[]  =   new   byte [ 1024 ];
buffer  =  mess.getBytes();
out.write(buffer); 
out.close(); // 关闭文件流 
}   catch  (IOException e)  {
  e.printStackTrace();
} 
 

#   re: 解决RandomAccessFile写入文件乱码的办法 2008-03-26 14:54 Find it, try it, experience it   回复   更多评论   

I didn't see any thing here can resolve the problem related to encoding.

#   re: 解决RandomAccessFile写入文件乱码的办法[未登录] 2008-03-26 15:07 AA   回复   更多评论   

明明就是追加,谁都会的

#   re: 解决RandomAccessFile写入文件乱码的办法 2008-03-28 11:07 senlin-blog   回复   更多评论   

你会说明你能,但不一定谁都会的,我是说明解决乱码的问题

#   re: 解决RandomAccessFile写入文件乱码的办法 2008-03-28 13:18 Find it, try it, experience it   回复   更多评论   

But...actually there is nothing related to encoding/decoding, you can have a try to set your JVM default encoding to be iso8859-1 or something other than GB2312/GBK/ GB18030, probly you will get something like "XXX" with your code with your input message "写入文件".
分享到:
评论
2 楼 gstarwd 2010-04-05  
xiaoqing20 写道

1 楼 xiaoqing20 2010-03-23  

相关推荐

Global site tag (gtag.js) - Google Analytics