title: Use jsoup to encode Html characters
body: <p>I have to encode characters to Html:</p>
  
  <pre><code>&lt; to &amp;lt;
  &gt; to &amp;gt;
  ' to &amp;#39;
  " to &amp;quot;
  &amp; to &amp;amp;
  </code></pre>
  
  <p>I look for a utility function like <a href="http://php.net/manual/en/function.htmlspecialchars.php" rel="nofollow">htmlspecialchars</a> in PHP:</p>
  
  <pre><code>String htmlspecialchars(String inputText)
  </code></pre>
  
  <p>Is it possible to use JSoup to encode these characters?</p>
  
  <p>(I have found <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/util/HtmlUtils.html#htmlEscape%28java.lang.String%29" rel="nofollow">htmlEscape</a> in the Spring framework, but I don't want to use the Spring framework just for this simple function.)</p>