MYSQL UDF插件好像不能返回结果集
MFC DLL工程, 静态库链接, UNICODE字符编码
新建cpp, 代码如下
#include "stdafx.h"
#include "tokenize.h"
#include "mysql/mysql.h"
#include
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
void UCS2_TO_UTF8(std::string &dst, const std::wstring &src)
{
size_t l, i;
l = src.length();
for (i = 0; i < l; i++)
{
wchar_t t;
t = src[i];
if (t <= 0x7F)
{
dst.push_back(t & 0x7F);
}
else if (t <= 0x7FF)
{
dst.push_back((6 << 5) | (t >> 11));
dst.push_back((2 << 6) | (t & 0x3F));
}
else
{
dst.push_back((14 << 4) | (t >> 12));
dst.push_back((2 << 6) | ((