code: public static String encodeChars(String iString)
      {
          if (iString == null)
              return "";
  
          int strLen = iString.length(), i;
  
          if (strLen < 1)
              return iString;
  
          // convert any special chars to their browser equivalent specification
          StringBuffer retString = new StringBuffer(strLen * 2);
  
          for (i = 0; i < strLen; i++)
          {
              switch (iString.charAt(i))
              {
                  case '<':
                      retString.append("&lt;");
                      break;
  
                  case '>':
                      retString.append("&gt;");
                      break;
  
                  case '&':
                      retString.append("&amp;");
                      break;
  
                  case '\"':
                      retString.append("&quot;");
                      break;
  
                  case '+':
                      retString.append("&#43;");
                      break;
  
                  case '(':
                      retString.append("&#40;");
                      break;
  
                  case ')':
                      retString.append("&#41;");
                      break;
  
                  case '\'':
                      retString.append("&#39;");
                      break;
  
                  case '%':
                      retString.append("&#37;");
                      break;
  
                  case ';':
                      retString.append("&#59;");
                      break;
  
                  default:
                      retString.append(iString.charAt(i));
                      break;
              }
          }
  
          return retString.toString();
      }
docs: 96236 - this method was added for defect 96236