windows支持gb2312编码

This commit is contained in:
xiongziliang
2017-10-10 00:04:07 +08:00
parent d26d484ecf
commit e1b732e944
4 changed files with 200 additions and 26 deletions

View File

@@ -37,13 +37,18 @@ namespace Http {
class strCoding {
public:
static string UrlUTF8Encode(const char * str); //urlutf8 编码
static string UrlUTF8Encode(const string &str); //urlutf8 编码
static string UrlUTF8Decode(const string &str); //urlutf8解码
static string UrlGB2312Encode(const string &str); //urlgb2312编码
static string UrlGB2312Decode(const string &str); //urlgb2312解码
#if defined(_WIN32)
static string UTF8ToGB2312(const string &str);//utf_8转为gb2312
static string GB2312ToUTF8(const string &str); //gb2312 转utf_8
#endif//defined(_WIN32)
private:
strCoding(void);
virtual ~strCoding(void);
static inline char CharToInt(char ch);
static inline char StrToBin(const char *str);
};
} /* namespace Http */