Improve url encode and decode code add user pass encode decode methond (#3468)

去除url转义的冗余代码,添加用户名与密码的转义
This commit is contained in:
xiongguangjie
2024-04-13 20:36:15 +08:00
committed by GitHub
parent 3dcd0ed463
commit d8cb75d387
3 changed files with 41 additions and 25 deletions

View File

@@ -22,6 +22,8 @@ public:
static std::string UrlEncodeComponent(const std::string &str); // url参数 utf8编码
static std::string UrlDecodePath(const std::string &str); //url路径 utf8解码
static std::string UrlDecodeComponent(const std::string &str); // url参数 utf8解码
static std::string UrlEncodeUserOrPass(const std::string &str); // url中用户名与密码编码
static std::string UrlDecodeUserOrPass(const std::string &str); // url中用户名与密码解码
#if defined(_WIN32)
static std::string UTF8ToGB2312(const std::string &str);//utf_8转为gb2312
static std::string GB2312ToUTF8(const std::string &str); //gb2312 转utf_8