Merge pull request #47512 from DanielKriz/bugfix/uri_encode

fix wrong encoding format in uri_encode
This commit is contained in:
Fabio Alessandrelli 2021-04-10 18:58:40 +02:00 committed by GitHub
commit 6138396e00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;