title: Freemarker converting HTML ISO tags when reading ftl file
body: <p>I am trying to output curly quotes in an HTML file that I am generating in Freemarker. The template file contains:</p>
  
  <pre><code>Kevin&amp;#8217;s
  </code></pre>
  
  <p>When the HTML file is generated, it comes out as:</p>
  
  <pre><code>Kevin?s
  </code></pre>
  
  <p>At first I thought that the issue was happening during the generation of the HTML file. But I was able to track down the conversion to when the template was read in. Does anyone know how to prevent Freemarker from doing this conversion when reading the template? My code for the conversion:</p>
  
  <pre><code>// Freemarker configuration object
  Configuration cfg = new Configuration(new Version(2, 3, 21));
  try
  {
    cfg.setDirectoryForTemplateLoading(new File("templates"));
    cfg.setDefaultEncoding("UTF-8");
    cfg.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER);
  
    // Load template from source folder
    Template template = cfg.getTemplate("curly.html");
    template.setEncoding("UTF-8");
  
    // Build the data-model
    Map&lt;String, Object&gt; data = new HashMap&lt;String, Object&gt;();
  
    // Console output
    Writer out = new OutputStreamWriter(System.out);
    template.process(data, out);
    out.flush();
  }
  catch (IOException e)
  {
    e.printStackTrace();
  }
  catch (TemplateException e)
  {
    e.printStackTrace();
  }
  </code></pre>