summaryrefslogtreecommitdiffabout
path: root/src/util.cc
Unidiff
Diffstat (limited to 'src/util.cc') (more/less context) (show whitespace changes)
-rw-r--r--src/util.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.cc b/src/util.cc
index 2e2d305..3166e62 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -6,13 +6,13 @@ namespace kingate {
6 static const char *safeChars = 6 static const char *safeChars =
7 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 7 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
8 "abcdefghijklmnopqrstuvwxyz" 8 "abcdefghijklmnopqrstuvwxyz"
9 "0123456789" 9 "0123456789"
10 "_-" ; 10 "_-" ;
11 11
12 string url_escape(const string& str) { 12 string url_encode(const string& str) {
13 string rv = str; 13 string rv = str;
14 string::size_type screwed = 0; 14 string::size_type screwed = 0;
15 for(;;) { 15 for(;;) {
16 screwed = rv.find_first_not_of(safeChars,screwed); 16 screwed = rv.find_first_not_of(safeChars,screwed);
17 if(screwed == string::npos) 17 if(screwed == string::npos)
18 break; 18 break;
@@ -27,13 +27,13 @@ namespace kingate {
27 screwed+=3; 27 screwed+=3;
28 } 28 }
29 } 29 }
30 } 30 }
31 return rv; 31 return rv;
32 } 32 }
33 string url_unescape(const string& str) { 33 string url_decode(const string& str) {
34 string rv = str; 34 string rv = str;
35 string::size_type unscrewed = 0; 35 string::size_type unscrewed = 0;
36 for(;;) { 36 for(;;) {
37 unscrewed = rv.find_first_of("%+",unscrewed); 37 unscrewed = rv.find_first_of("%+",unscrewed);
38 if(unscrewed == string::npos) 38 if(unscrewed == string::npos)
39 break; 39 break;