Commit efb78a9d by 李定达

1.RES和spn导出接口统一;2.修复部分bug

parent 1606d0df
No preview for this file type
...@@ -617,7 +617,10 @@ int SaveRollBackFile(const string text) ...@@ -617,7 +617,10 @@ int SaveRollBackFile(const string text)
return 1; return 1;
} }
int GetValue(char *indata, char *outdata) extern "C"
{
__declspec(dllexport) int _stdcall GetValue(char *indata, char *outdata)
{ {
int reqType_i = 0; int reqType_i = 0;
...@@ -750,6 +753,7 @@ endflag: ...@@ -750,6 +753,7 @@ endflag:
return 1; return 1;
} }
}
extern "C" extern "C"
{ {
...@@ -867,7 +871,7 @@ int UTF8ToGBK(unsigned char * lpUTF8Str,unsigned char * lpGBKStr,int nGBKStrLen) ...@@ -867,7 +871,7 @@ int UTF8ToGBK(unsigned char * lpUTF8Str,unsigned char * lpGBKStr,int nGBKStrLen)
nRetLen = MultiByteToWideChar(CP_UTF8,0,(char *)lpUTF8Str,-1,NULL,NULL); //获取转换到Unicode编码后所需要的字符空间长度 nRetLen = MultiByteToWideChar(CP_UTF8,0,(char *)lpUTF8Str,-1,NULL,NULL); //获取转换到Unicode编码后所需要的字符空间长度
//lpUnicodeStr = new WCHAR[nRetLen + 1]; //为Unicode字符串空间 //lpUnicodeStr = new WCHAR[nRetLen + 1]; //为Unicode字符串空间
lpUnicodeStr = (WCHAR*)malloc( sizeof(WCHAR)*(nRetLen + 1)); lpUnicodeStr = (WCHAR*)malloc( sizeof(WCHAR)*(nRetLen + 1));
memset(lpUnicodeStr, 0, nRetLen + 1); memset(lpUnicodeStr, 0, sizeof(WCHAR)*(nRetLen + 1));
nRetLen = MultiByteToWideChar(CP_UTF8,0,(char *)lpUTF8Str,-1,lpUnicodeStr,nRetLen); //转换到Unicode编码 nRetLen = MultiByteToWideChar(CP_UTF8,0,(char *)lpUTF8Str,-1,lpUnicodeStr,nRetLen); //转换到Unicode编码
if(!nRetLen) //转换失败则出错退出 if(!nRetLen) //转换失败则出错退出
return 0; return 0;
...@@ -986,11 +990,13 @@ int SendMsg(const std::string &text, const string &url, int iscret) ...@@ -986,11 +990,13 @@ int SendMsg(const std::string &text, const string &url, int iscret)
LOG() << "get sign : " << sign; LOG() << "get sign : " << sign;
headers = curl_slist_append(headers, string("sign:").append(sign).c_str()); headers = curl_slist_append(headers, string("sign:").append(sign).c_str());
} }
headers = curl_slist_append(headers, "Content-Type:text/json"); headers = curl_slist_append(headers, "Content-Type:application/json;charset=utf-8");
headers = curl_slist_append(headers, "Accept:application/json");
} }
else else
{ {
headers = curl_slist_append(headers, "Content-Type:text"); headers = curl_slist_append(headers, "Content-Type:text;charset=utf-8");
headers = curl_slist_append(headers, "Accept:text");
} }
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment