mirror of
https://github.com/gbevin/urlencoder.git
synced 2025-06-16 20:10:52 -07:00
Added allow parameter
This commit is contained in:
parent
5a0c682f6f
commit
e62af2cf4b
2 changed files with 128 additions and 113 deletions
|
@ -7,7 +7,7 @@
|
|||
A simple library to encode/decode URL parameters.
|
||||
|
||||
This library was extracted from the [RIFE2 Web Application Framework](https://rife2.com).
|
||||
The Kotlin version can be found at [https://github.com/ethauvin/urlencoder](https://github.com/ethauvin/urlencoder).
|
||||
A Kotlin version can also be found at [https://github.com/ethauvin/urlencoder](https://github.com/ethauvin/urlencoder).
|
||||
|
||||
For decades, we've been using [java.net.URLEncoder](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/net/URLEncoder.html)
|
||||
because of its improper naming. It is actually intended to encode HTML form
|
||||
|
@ -22,6 +22,7 @@ also addresses this issue.
|
|||
UrlEncoder.encode("a test &"); // -> "a%20test%20%26"
|
||||
UrlEncoder.encode("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVQXYZ0123456789-_.~"); // -> "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVQXYZ0123456789-_.~"
|
||||
UrlEncoder.encode("%#okékÉȢ smile!😁"); // -> "%25%23ok%C3%A9k%C3%89%C8%A2%20smile%21%F0%9F%98%81"
|
||||
UrlEncoder.encode("?test=a test", "?="); // -> ?test=a%20test
|
||||
|
||||
UrlEncoder.decode("a%20test%20%26"); // -> "a test &"
|
||||
UrlEncoder.decode("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVQXYZ0123456789-_.~"); // -> "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVQXYZ0123456789-_.~"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue