在创建输出流的时候:
//Writer out=new FileWriter(new File(STATIC_PAGE_PATH+itemId+".html"));//出现乱码
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(STATIC_PAGE_PATH+itemId+".html")),"UTF-8"));//使用这个方式创建就不会出现乱码了
时间: 2024-11-09 00:13:28