Make it easier to see which characters will be encoded

This commit is contained in:
OHTAKE Tomohiro committed 2012-06-13 17:43:06 +09:00
1 parent bdaf5eadc2
commit ea9ff25f98
1 file changed
+3 -3
+3 -3
View File
@@ -703,14 +703,14 @@ public class Util {
private static final boolean[] uriMap = new boolean[123];
static {
String raw =
"! $ &'()*+,-. 0123456789 = @ABCDEFGHIJKLMNOPQRSTUVWXYZ _ abcdefghijklmnopqrstuvwxyz";
// "# % / :;< >? [\]^ ` {|}~
"! $ '()*+,-. 0123456789 = @ABCDEFGHIJKLMNOPQRSTUVWXYZ _ abcdefghijklmnopqrstuvwxyz";
// "# %& / :;< >? [\]^ ` {|}~
// ^--so these are encoded
int i;
// Encode control chars and space
for (i = 0; i < 33; i++) uriMap[i] = true;
for (int j = 0; j < raw.length(); i++, j++)
uriMap[i] = (raw.charAt(j) == ' ' || raw.charAt(j) =='&');
uriMap[i] = (raw.charAt(j) == ' ');
// If we add encodeQuery() just add a 2nd map to encode &+=
// queryMap[38] = queryMap[43] = queryMap[61] = true;
}