summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-04-10 18:58:40 +0200
committerGitHub <noreply@github.com>2021-04-10 18:58:40 +0200
commit6138396e0020e1e92224b4d882ef5e8217fa12f7 (patch)
treefae11eb2a83502602e32bcdff9ab95c3247cf007
parent8b6e3d63750db5eab94b5d4e5dc182a678c1e455 (diff)
parent13c999d9d75887ecacd1a7348ad0267131252b13 (diff)
Merge pull request #47512 from DanielKriz/bugfix/uri_encode
fix wrong encoding format in uri_encode
-rw-r--r--core/string/ustring.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp
index 05c80296c2..cf0040353d 100644
--- a/core/string/ustring.cpp
+++ b/core/string/ustring.cpp
@@ -3772,9 +3772,9 @@ String String::uri_encode() const {
} else {
char h_Val[3];
#if defined(__GNUC__) || defined(_MSC_VER)
- snprintf(h_Val, 3, "%hhX", ord);
+ snprintf(h_Val, 3, "%02hhX", ord);
#else
- sprintf(h_Val, "%hhX", ord);
+ sprintf(h_Val, "%02hhX", ord);
#endif
res += "%";
res += h_Val;