File fileFullPath = new File(filePath + File.separator + fileName);
  
  File idDir = new File(filePath);
  if( !idDir.exists() ) { idDir.mkdirs(); }
  fileFullPath.createNewFile();
 
  FileOutputStream fos = new FileOutputStream(fileFullPath);
  Writer writer = new OutputStreamWriter(fos, "UTF-8");
//  fos.write(text.getBytes());
  writer.write(text);
//  fos.close();
  writer.close();
 

 

Posted by 張's blog
,