https://stackoverflow.com/a/17708801/361413 TODO convert to wx-only
| 14 | // https://stackoverflow.com/a/17708801/361413 |
| 15 | // TODO convert to wx-only |
| 16 | static string url_encode(const string &value) { |
| 17 | ostringstream escaped; |
| 18 | escaped.fill('0'); |
| 19 | escaped << hex; |
| 20 | |
| 21 | for (string::const_iterator i = value.begin(), n = value.end(); i != n; ++i) { |
| 22 | string::value_type c = (*i); |
| 23 | |
| 24 | // Keep alphanumeric and other accepted characters intact |
| 25 | if (isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') { |
| 26 | escaped << c; |
| 27 | continue; |
| 28 | } |
| 29 | |
| 30 | // Any other characters are percent-encoded |
| 31 | escaped << uppercase; |
| 32 | escaped << '%' << setw(2) << int((unsigned char) c); |
| 33 | escaped << nouppercase; |
| 34 | } |
| 35 | |
| 36 | return escaped.str(); |
| 37 | } |
| 38 | |
| 39 | bool DebugReportEmail::DoProcess() |
| 40 | { |