title: Have Spring tell FreeMarker the URL encoding to use
body: <p>I am using FreeMarker with Spring to generate my HTML pages. In my Freemarker page I try to URL escape a <code>String</code> value, like this:</p>
  
  <pre><code>        &lt;a href="&lt;@spring.url "/ext/Thing/${thing?url}/"/&gt;"&gt;Thing ${thing}&lt;/a&gt;
  </code></pre>
  
  <p>This results in an exception from FreeMarker that complains</p>
  
  <blockquote>
    <p>ERROR 2014-02-03 11:08:45,513 Error executing FreeMarker template
    FreeMarker template error:
    To do URL encoding, the framework that encloses FreeMarker must specify the output encoding or the URL encoding charset, so ask the programmers to fix it. Or, as a last chance, you can set the url_encoding_charset setting in the template, e.g. &lt;#setting url_escaping_charset='ISO-8859-1'>, or give the charset explicitly to the buit-in, e.g. foo?url('ISO-8859-1').</p>
  </blockquote>
  
  <p>What to do to fix this problem?</p>