encode(str, ret, null);
encode(str, ret, false, null);
    public final static String encode(String str) {        if (str == null) {            return null;        }        int l = str.length();        if (l == 0) {            return "";        }        // try to make stringbuffer large enough from the start        StringBuffer ret = new StringBuffer(Math.round(l * 1.4f));        encode(str, ret, null);        return ret.toString();    }