Added spaceToPlus parameter to encode function

This commit is contained in:
Erik C. Thauvin 2023-01-05 20:42:00 -08:00
parent 50ffe56ba8
commit f8b9376f40
6 changed files with 41 additions and 39 deletions

View file

@ -37,6 +37,7 @@ compared to other solutions like the standard `URLEncoder` in the JDK.
UrlEncoder.encode("a test &") // -> a%20test%20%26
UrlEncoder.encode("%#okékÉȢ smile!😁") // -> %25%23ok%C3%A9k%C3%89%C8%A2%20smile%21%F0%9F%98%81
UrlEncoder.encode("?test=a test", allow = "?=") // -> ?test=a%20test
UrlEncoder.endode("foo bar", spaceToPlus = true) // -> foo+bar
UrlEncoder.decode("a%20test%20%26") // -> a test &
UrlEncoder.decode("%25%23ok%C3%A9k%C3%89%C8%A2%20smile%21%F0%9F%98%81") // -> %#okékÉȢ smile!😁