File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ string URL::Encode(const string& s, bool full) {
89
89
string::value_type c = (*i);
90
90
91
91
// Keep alphanumeric and other accepted characters intact
92
- if (!full && (isalnum (c) || c == ' -' || c == ' _' || c == ' .' || c == ' ~' )) {
92
+ if (!full && (isalnum (( unsigned char ) c) || c == ' -' || c == ' _' || c == ' .' || c == ' ~' )) {
93
93
escaped << c;
94
94
continue ;
95
95
}
Original file line number Diff line number Diff line change @@ -106,6 +106,9 @@ TEST(TestURL, EncodeNotFull)
106
106
107
107
enc = URL::Encode (" {\" k1\" : \" v\" , \" k2\" : 123}" , false );
108
108
ASSERT_EQ (enc, " %7B%22k1%22%3A%20%22v%22%2C%20%22k2%22%3A%20123%7D" );
109
+
110
+ enc = URL::Encode (" ⌘" , false );
111
+ ASSERT_EQ (enc, " %E2%8C%98" );
109
112
}
110
113
111
114
TEST (TestURL, EncodeFull)
@@ -124,4 +127,7 @@ TEST(TestURL, EncodeFull)
124
127
125
128
enc = URL::Encode (" {\" k1\" : \" v\" , \" k2\" : 123}" , true );
126
129
ASSERT_EQ (enc, " %7B%22%6B%31%22%3A%20%22%76%22%2C%20%22%6B%32%22%3A%20%31%32%33%7D" );
130
+
131
+ enc = URL::Encode (" ⌘" , false );
132
+ ASSERT_EQ (enc, " %E2%8C%98" );
127
133
}
You can’t perform that action at this time.
0 commit comments