mirror of
https://github.com/gbevin/urlencoder.git
synced 2025-04-24 23:07:12 -07:00
Minor clarifications
This commit is contained in:
parent
b12f3eafd7
commit
954aa3e92e
1 changed files with 3 additions and 1 deletions
|
@ -32,6 +32,7 @@ public final class UrlEncoder {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// see https://www.rfc-editor.org/rfc/rfc3986#page-13
|
// see https://www.rfc-editor.org/rfc/rfc3986#page-13
|
||||||
|
// and https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set
|
||||||
var unreserved = new BitSet('z' + 1);
|
var unreserved = new BitSet('z' + 1);
|
||||||
unreserved.set('-');
|
unreserved.set('-');
|
||||||
unreserved.set('.');
|
unreserved.set('.');
|
||||||
|
@ -224,6 +225,7 @@ public final class UrlEncoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
// see https://www.rfc-editor.org/rfc/rfc3986#page-13
|
// see https://www.rfc-editor.org/rfc/rfc3986#page-13
|
||||||
|
// and https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set
|
||||||
private static boolean isUnreservedUriChar(char ch) {
|
private static boolean isUnreservedUriChar(char ch) {
|
||||||
return ch <= 'z' && UNRESERVED_URI_CHARS.get(ch);
|
return ch <= 'z' && UNRESERVED_URI_CHARS.get(ch);
|
||||||
}
|
}
|
||||||
|
@ -262,7 +264,7 @@ public final class UrlEncoder {
|
||||||
|
|
||||||
if (!valid_arguments) {
|
if (!valid_arguments) {
|
||||||
return new MainResult("Usage : java -jar urlencoder-*.jar [-ed] text" + System.lineSeparator() +
|
return new MainResult("Usage : java -jar urlencoder-*.jar [-ed] text" + System.lineSeparator() +
|
||||||
"Encode and decode URL parameters." + System.lineSeparator() +
|
"Encode and decode URL components defensively." + System.lineSeparator() +
|
||||||
" -e encode (default)" + System.lineSeparator() +
|
" -e encode (default)" + System.lineSeparator() +
|
||||||
" -d decode", 1);
|
" -d decode", 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue