This commit is contained in:
yhirose 2021-12-26 07:53:06 -05:00
parent b324921c1a
commit 865b0e4c03
2 changed files with 10 additions and 0 deletions

View file

@ -1661,6 +1661,8 @@ namespace detail {
std::string encode_query_param(const std::string &value); std::string encode_query_param(const std::string &value);
std::string decode_url(const std::string &s, bool convert_plus_to_space);
void read_file(const std::string &path, std::string &out); void read_file(const std::string &path, std::string &out);
std::string trim_copy(const std::string &s); std::string trim_copy(const std::string &s);

View file

@ -58,6 +58,14 @@ TEST(StartupTest, WSAStartup) {
} }
#endif #endif
TEST(DecodeURLTest, PercentCharacter) {
EXPECT_EQ(
detail::decode_url(
R"(descrip=Gastos%20%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA%C3%B1%C3%91%206)",
false),
R"(descrip=Gastos áéíóúñÑ 6)");
}
TEST(EncodeQueryParamTest, ParseUnescapedChararactersTest) { TEST(EncodeQueryParamTest, ParseUnescapedChararactersTest) {
string unescapedCharacters = "-_.!~*'()"; string unescapedCharacters = "-_.!~*'()";