axmol/cocos2dx/platform/bada/Gbk_Unicode.h

43 lines
1.1 KiB
C
Raw Normal View History

2011-09-20 02:19:26 +08:00
/*
* Gbk_Unicode.h
*
* Created on: 2011-9-12
* Author: dumganhar
*/
#ifndef GBK_UNICODE_H_
#define GBK_UNICODE_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* param:
* pGbkOut[out]:<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Gbk<EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD>
* iGbkBufSize[in]:<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Gbk<EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λΪ<EFBFBD>ֽ<EFBFBD>, <EFBFBD><EFBFBD>pGbkOutΪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>sizeof()<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* pUnicodeIn[in]:<EFBFBD><EFBFBD>Ҫת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>unicode<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* return: 0:ʧ<EFBFBD><EFBFBD>, 1: <EFBFBD>ɹ<EFBFBD>
*/
int MyUnicodeToGBK(char* pGBKOut, int iGbkBufSize, const unsigned short* pUnicodeIn);
/*
* param:
* pUnicodeOut[out]:<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>unicode<EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD>
* iUniBufSize[in]:<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>unicode<EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λΪ<EFBFBD>ֽ<EFBFBD>, <EFBFBD><EFBFBD>pUnicodeOutΪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>sizeof()<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* pGBKIn[in]:<EFBFBD><EFBFBD>Ҫת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>gbk<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* return: 0:ʧ<EFBFBD><EFBFBD>, 1: <EFBFBD>ɹ<EFBFBD>
*/
int MyGBKToUnicode(unsigned short* pUnicodeOut, int iUniBufSize, const char* pGBKIn);
// ppszOutUtf8Ϊ<38><CEAA>ָ<EFBFBD><D6B8><EFBFBD>ĵ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EBA3AC><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>丳ֵ<E4B8B3><D6B5>_M<5F><4D><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>free<65>ͷ<EFBFBD>
int MyGBKToUTF8_M(char** ppszOutUtf8, char* pszGbk);
// ppszOutGbkΪ<6B><CEAA>ָ<EFBFBD><D6B8><EFBFBD>ĵ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EBA3AC><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>丳ֵ<E4B8B3><D6B5>_M<5F><4D><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>free<65>ͷ<EFBFBD>
int MyUTF8ToGBK_M(char** ppszOutGbk, char* pszUtf8);
#ifdef __cplusplus
}
#endif
#endif /* GBK_UNICODE_H_ */