浏览代码

fix wrong encoding in uri_encode

Daniel Kříž 4 年之前
父节点
当前提交
13c999d9d7
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      core/string/ustring.cpp

+ 2 - 2
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;