Skip to content

Commit

Permalink
refactor(common-utils): Prefer a symbolic name for the charset
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed May 24, 2024
1 parent 5f31ec6 commit 11baaeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/common/src/main/kotlin/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ fun String.normalizeLineBreaks() = replace(NON_LINUX_LINE_BREAKS, "\n")
* Return the [percent-encoded](https://en.wikipedia.org/wiki/Percent-encoding) string.
*/
fun String.percentEncode(): String =
java.net.URLEncoder.encode(this, "UTF-8")
java.net.URLEncoder.encode(this, Charsets.UTF_8)
// As "encode" above actually performs encoding for forms, not for query strings, spaces are encoded as
// "+" instead of "%20", so apply the proper mapping here afterwards ("+" in the original string is
// encoded as "%2B").
Expand Down

0 comments on commit 11baaeb

Please sign in to comment.