code: public static String escapeWBlanks(String source, String encoding) {
  
          if (CmsStringUtil.isEmpty(source)) {
              return source;
          }
          StringBuffer ret = new StringBuffer(source.length() * 2);
  
          // URLEncode the text string
          // this produces a very similar encoding to JavaSscript encoding,
          // except the blank which is not encoded into "%20" instead of "+"
  
          String enc = encode(source, encoding);
          for (int z = 0; z < enc.length(); z++) {
              char c = enc.charAt(z);
              if (c == '+') {
                  ret.append("%20");
              } else {
                  ret.append(c);
              }
          }
          return ret.toString();
      }
docs: Encodes a String in a way similar JavaScript "encodeURIcomponent" function.<p>
  
  Multiple blanks are encoded _multiply_ with <code>%20</code>.<p>
  
  @param source The text to be encoded
  @param encoding the encoding type
  
  @return The encoded String