-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathChineseConvert.h
More file actions
40 lines (30 loc) · 1.03 KB
/
ChineseConvert.h
File metadata and controls
40 lines (30 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// ChineseConvert.h: interface for the CChineseConvert class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_CHINESECONVERT_H__1515F40D_636D_44CC_8A84_5F979CCE9634__INCLUDED_)
#define AFX_CHINESECONVERT_H__1515F40D_636D_44CC_8A84_5F979CCE9634__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <string>
using namespace std;
//debug and log
extern FILE* g_fp;
void Log2File(const char* format_str, ...);
class CChineseConvert
{
public:
CChineseConvert();
virtual ~CChineseConvert();
//从UTF-8编码的URL专用格式字符串还原成普通字符串
static string Url_Utf8ToGB2312(string& instr);
//UTF-8转GB2312
static char* UTF8ToGB2312(const char* pStrUTF8);
//检测是否UTF-8字符串
static bool IsUTF8String(const char* pStr);
private:
static char Char2Int(char ch);
static char Str2Bin(char *str);
static string UrlDecode(const string& str);
};
#endif // !defined(AFX_CHINESECONVERT_H__1515F40D_636D_44CC_8A84_5F979CCE9634__INCLUDED_)