move URLEncode into RageUtil

This commit is contained in:
Glenn Maynard
2006-02-09 00:08:10 +00:00
parent c1848ab4a5
commit 478de001c6
4 changed files with 15 additions and 15 deletions
+14
View File
@@ -934,6 +934,20 @@ bool EndsWith( const RString &sTestThis, const RString &sEnding )
return sTestThis.compare( sTestThis.length()-sEnding.length(), sEnding.length(), sEnding ) == 0;
}
RString URLEncode( const RString &sStr )
{
RString sOutput;
for( unsigned k = 0; k < sStr.size(); k++ )
{
char t = sStr[k];
if( t >= '!' && t <= 'z' )
sOutput += t;
else
sOutput += "%" + ssprintf( "%X", t );
}
return sOutput;
}
void StripCvs( vector<RString> &vs )
{
for( unsigned i=0; i<vs.size(); i++ )