HTML "'% Escape + Encode

char better resolution
% URL Encoder %XX %25
% File in program record %
% URL request %25
' GQL query \\'
' HTML attribute src="" < src=''
' Program Encoding %27
' File in program record '
" HTML attribute %22
" URL Encoder %22
" program request parser error generate file name*
" File in program record "

*attachments /file/HTML %22%27%25 Escape + Encode/1309111991205.png was originally "copy" of rect2833.png

URL Decode

HttpServletRequest.getPathInfo();
not URLDecoder.decode(req.getRequestURI(), "UTF-8");

it's offers Bug when URL has %

encode and decode

    protected static String decode(final String str)
    {
        return str.replace("%22", "\"").replace("%27", "'").replace("%25", "%");
    }

    protected static String encode(final String str)
    {
        return str.replace("%", "%25").replace("'", "%27").replace("\"", "%22");
    }

Parser Tsr.java

            String dw = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
            return str.replaceAll("%(([^"+dw+"][^"+dw+"])?)", "%25$1");

FileList Atms.java

                final String purl = "/file/" + Wiki.encode(s) + "/" + Wiki.encode(f.name());
                out.write("<a href=\"" + purl + "\" style='display:block;'>" + f.name() + "</a>");//not encoded in f. f.name() is human readable

Character Encode

All Encode on Java Program UTF-8
HTML form accept "utf-8"
Java
Servlet.setCharacterEncoding("UTF-8");
HTML
<!DOCTYPE html><meta http-equiv='Content-Type' content='text/html; charset=utf-8' />"
<form accept-charset='utf-8' method='post' /></form>
See [attachments] bar ↓
    last modified: 11 July 2011 [ View wiki source Close ]
     
SEARCH DIFFERENCE ATTACHMENT RECENT POST