Rename EscapeUrl to EncodeUrl

This commit is contained in:
Birunthan Mohanathas
2014-01-04 21:47:45 +02:00
parent 39c6c62abd
commit 27164b8e75
4 changed files with 9 additions and 9 deletions

View File

@ -78,7 +78,7 @@ void EscapeRegExp(std::wstring& str)
/*
** Escapes reserved URL characters.
*/
void EscapeUrl(std::wstring& str)
void EncodeUrl(std::wstring& str)
{
size_t pos = 0;
while ((pos = str.find_first_of(L" !*'();:@&=+$,/?#[]", pos)) != std::wstring::npos)

View File

@ -38,7 +38,7 @@ inline std::wstring WidenUTF8(const std::string& str) { return Widen(str.c_str()
void EscapeRegExp(std::wstring& str);
void EscapeUrl(std::wstring& str);
void EncodeUrl(std::wstring& str);
} // namespace StringUtil

View File

@ -47,10 +47,10 @@ public:
Assert::AreEqual(L"\\\\\\^\\$\\|\\(test\\)\\[\\{\\. ing\\+\\*\\?", str.c_str());
}
TEST_METHOD(TestEscapeUrl)
TEST_METHOD(TestEncodeUrl)
{
std::wstring str = L" !*'();:@test&=+$,/?#[ing]";
EscapeUrl(str);
EncodeUrl(str);
Assert::AreEqual(L"%20%21%2A%27%28%29%3B%3A%40test%26%3D%2B%24%2C%2F%3F%23%5Bing%5D", str.c_str());
}
};