| 141 | } |
| 142 | |
| 143 | static int hex_to_int(char c) { |
| 144 | if (c >= 'a' && c <= 'f') { |
| 145 | return c - 'a' + 10; |
| 146 | } else if (c >= 'A' && c <= 'F') { |
| 147 | return c - 'A' + 10; |
| 148 | } else if (c >= '0' && c <= '9') { |
| 149 | return c - '0'; |
| 150 | } |
| 151 | return 0; |
| 152 | } |
| 153 | |
| 154 | void PercentDecode(const std::string& str, std::string* str_out) { |
| 155 | std::ostringstream unescaped; |