code: protected String getSymbolEntity(String str)
      {
          String entity = null;
          if (isHtmlEntities()) {
              entity = WikiEntityUtil.getHtmlSymbol(str);
          } else {
              int code = WikiEntityUtil.getHtmlCodeByWikiSymbol(str);
              if (code > 0) {
                  entity = "#" + Integer.toString(code);
              }
          }
          if (entity != null) {
              entity = "&" + entity + ";";
              if (str.startsWith(" --")) {
                  entity = "&#160;" + entity + " ";
              }
          }
          return entity;
      }
docs: Returns an HTML/XML entity corresponding to the specified special symbol.
  Depending on implementation it can be real entities (like &amp;amp;
  &amp;lt; &amp;gt; or the corresponding digital codes (like &amp;#38;,
  &amp;#&amp;#38; or &amp;#8250;). Digital entity representation is better
  for generation of XML files.
  
  @param str the special string to convert to an HTML/XML entity
  @return an HTML/XML entity corresponding to the specified special symbol.