You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
997 B
C++

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

//////////////////////////////////////////////////////////////////////////////
//文件 ChineseCode.h
//主要功能:
// 汉字GB2312与UTF-8编码互转
//
//程序编写: 2006-3-08
/////////////////////////////////////////////////////////////////////////////
#if !defined(__CCHINESECODELIB_H_)
#define __CCHINESECODELIB_H_
class AFX_EXT_CLASS CChineseCode
{
public:
CChineseCode();
virtual ~CChineseCode();
static CString UTF_8ToGB2312(char *pText, int pLen);
static CString GB2312ToUTF_8(char *pText, int pLen);
static void UnicodeToUTF_8(char* pOut,WCHAR* pText); // Unicode 转换成UTF-8
static void UTF_8ToUnicode(WCHAR* pOut,char* pText); // 把UTF-8转换成Unicode
static void Gb2312ToUnicode(WCHAR* pOut,char *gbBuffer); // GB2312 转换成 Unicode
static void UnicodeToGB2312(char* pOut,unsigned short uData); // 把Unicode 转换成 GB2312
static CStringW UTF8toUTF16(const CStringA& utf8);
static CStringA UTF16toUTF8(const CStringW& utf16);
};
#endif // !defined(__CCHINESECODELIB_H_)