| 371 | |
| 372 | |
| 373 | std::string UrlANSI(const char *str) |
| 374 | { |
| 375 | std::string dd; |
| 376 | std::string tt = str; |
| 377 | size_t len = tt.length(); |
| 378 | for (size_t i = 0; i < len; i++) |
| 379 | { |
| 380 | BYTE b = (BYTE)tt.at(i); |
| 381 | /*if (isalnum(b) |
| 382 | || b == '/' |
| 383 | || b == '.' |
| 384 | || b == ':')*/ |
| 385 | if (b >= 0 && b < 127) |
| 386 | { |
| 387 | char tempbuff[2] = { 0 }; |
| 388 | sprintf(tempbuff, "%c", (BYTE)tt.at(i)); |
| 389 | dd.append(tempbuff); |
| 390 | } |
| 391 | else if (isspace(b)) |
| 392 | { |
| 393 | dd.append("+"); |
| 394 | } |
| 395 | else |
| 396 | { |
| 397 | char tempbuff[4]; |
| 398 | sprintf(tempbuff, "%%%X%X", ((BYTE)tt.at(i)) >> 4, ((BYTE)tt.at(i)) % 16); |
| 399 | dd.append(tempbuff); |
| 400 | } |
| 401 | } |
| 402 | return dd; |
| 403 | } |
| 404 | |
| 405 | CString getCurrentTime() |
| 406 | { |