今天发现linux下freemarker发布出来的文件有乱码,整了半天总算搞定。。。。
先发一下参考资料:http://www.ntsky.com/tech/java/opensource/template/2007-10-20/59e034abc198936c.html
cfg = new Configuration();
cfg.setClassForTemplateLoading(TEST.class, "/templates/");
cfg.setEncoding(Locale.CHINA, "GBK");
Template t = cfg.getTemplate("abc.ftl", Locale.CHINA);
new PrintWriter(f, "GBK");
备忘一下。。。。