From 11baaebad9a18902db28af89cb41499521de30af Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Fri, 24 May 2024 12:25:08 +0200 Subject: [PATCH] refactor(common-utils): Prefer a symbolic name for the charset Signed-off-by: Sebastian Schuberth --- utils/common/src/main/kotlin/Extensions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/common/src/main/kotlin/Extensions.kt b/utils/common/src/main/kotlin/Extensions.kt index 20ebc2e3f4e5..b28fea01d764 100644 --- a/utils/common/src/main/kotlin/Extensions.kt +++ b/utils/common/src/main/kotlin/Extensions.kt @@ -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").