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

freemarker编码设置

    博客分类:
  • Java
阅读更多
Configuration cfg = new Configuration();
cfg.setDefaultEncoding("UTF-8");
......
Template template = cfg.getTemplate(templateFileName);
template.setEncoding("UTF-8");
creatDirs(buildPath.getFilename(),htmlFilePath);
File htmlFile = new File(buildPath + htmlFilePath + htmlFileName);
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(htmlFile),"UTF-8"));
template.process(propMap,out);
out.flush();

 

分享到:
评论
Global site tag (gtag.js) - Google Analytics