Browse Source

fix wrong encoding in uri_encode

(cherry picked from commit 13c999d9d75887ecacd1a7348ad0267131252b13)
Daniel Kříž 4 years ago
parent
commit
edcb95cede
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/ustring.cpp

+ 2 - 2
core/ustring.cpp

@@ -3451,9 +3451,9 @@ String String::http_escape() const {
 		} else {
 		} else {
 			char h_Val[3];
 			char h_Val[3];
 #if defined(__GNUC__) || defined(_MSC_VER)
 #if defined(__GNUC__) || defined(_MSC_VER)
-			snprintf(h_Val, 3, "%hhX", ord);
+			snprintf(h_Val, 3, "%02hhX", ord);
 #else
 #else
-			sprintf(h_Val, "%hhX", ord);
+			sprintf(h_Val, "%02hhX", ord);
 #endif
 #endif
 			res += "%";
 			res += "%";
 			res += h_Val;
 			res += h_Val;