code: public static String escapeNonAscii(String source) {
  
          if (source == null) {
              return null;
          }
          StringBuffer result = new StringBuffer(source.length() * 2);
          for (int i = 0; i < source.length(); i++) {
              int ch = source.charAt(i);
              if (ch > 255) {
                  result.append(ENTITY_PREFIX);
                  result.append(ch);
                  result.append(";");
              } else {
                  result.append((char)ch);
              }
          }
          return new String(result);
      }
docs: Escapes non ASCII characters in a HTML-String with their number-based
  entity representation, for example &amp; becomes &amp;#38;.<p>
  
  A character <code>num</code> is replaced if<br>
  <code>(ch > 255)</code><p>
  
  @param source the String to escape
  
  @return String the escaped String
  
  @see #escapeXml(String)