urlencode.h 587 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * urlencode.h
  3. *
  4. * Created on: 2022年6月1日
  5. * Author: dingxy
  6. */
  7. #ifndef _CORE_URLENCODE_H_
  8. #define _CORE_URLENCODE_H_
  9. #include <string>
  10. #include <ctype.h>
  11. //#define ASC2_0 48
  12. //#define ASC2_A 65
  13. //#define ASC2_Z 90
  14. //#define ASC2_a 97
  15. //#define ASC2_z 122
  16. using namespace std;
  17. unsigned char toHex(unsigned char c);
  18. unsigned char fromHex(unsigned char h);
  19. void encodeUrl(const string& str, string& result);
  20. void encodeUrl(const char* str, string& result);
  21. void decodeUrl(const string& str, string& result);
  22. void decodeUrl(const char* str, string& result);
  23. #endif