url.h 915 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <iostream>
  3. #include <string>
  4. #include <windows.h>
  5. using namespace std;
  6. class strCoding
  7. {
  8. public:
  9. strCoding(void);
  10. ~strCoding(void);
  11. static void UTF_8ToGB2312(string &pOut, char *pText, int pLen);//utf_8转为gb2312
  12. static void GB2312ToUTF_8(string& pOut, char *pText, int pLen); //gb2312 转utf_8
  13. static string UrlGB2312(char * str); //urlgb2312编码
  14. static string UrlUTF8(char * str); //urlutf8 编码
  15. static string UrlUTF8Decode(string str); //urlutf8解码
  16. static string UrlGB2312Decode(string str); //urlgb2312解码
  17. private:
  18. static void Gb2312ToUnicode(WCHAR* pOut, char *gbBuffer);
  19. static void UTF_8ToUnicode(WCHAR* pOut, char *pText);
  20. static void UnicodeToUTF_8(char* pOut, WCHAR* pText);
  21. static void UnicodeToGB2312(char* pOut, WCHAR uData);
  22. static char CharToInt(char ch);
  23. static char StrToBin(char *str);
  24. };