Skip to content

Commit

Permalink
default_encoding: UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
moshowgame committed Jun 21, 2020
1 parent 82f9ef9 commit 2710873
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import java.io.IOException;
import java.io.StringWriter;
import java.util.Locale;
import java.util.Map;

/**
Expand Down Expand Up @@ -44,6 +45,10 @@ public static String escapeString(String originStr){
freemarkerConfig.setClassForTemplateLoading(FreemarkerUtil.class, "/templates/code-generator");
freemarkerConfig.setTemplateLoader(new ClassTemplateLoader(FreemarkerUtil.class, "/templates/code-generator"));
//freemarkerConfig.setDirectoryForTemplateLoading(new File(templatePath, "templates/code-generator"));
freemarkerConfig.setNumberFormat("#");
freemarkerConfig.setClassicCompatible(true);
freemarkerConfig.setDefaultEncoding("UTF-8");
freemarkerConfig.setLocale(Locale.CHINA);
freemarkerConfig.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
} catch (Exception e) {
log.error(e.getMessage(), e);
Expand Down

0 comments on commit 2710873

Please sign in to comment.