1、修正gcc编译器无法正确编译无明确引用_Parameter.h造成的参数异常

2、将utf8和gb2312字符互相转化改为utf8和GBK字符互相转化
This commit is contained in:
fasiondog 2017-07-23 02:37:26 +08:00
parent 4125d8f8a3
commit 6d45b3c6b2
8 changed files with 18 additions and 6 deletions

View File

@ -211,9 +211,11 @@ string HKU_API utf8_to_gb(const string& szinput) {
memset(outbuf, 0, outlen);
char *in = inbuf;
char *out = outbuf;
iconv_t cd=iconv_open("gb2312","utf-8");
iconv_t cd=iconv_open("gbk","utf-8");
iconv(cd, &in, &inlen, &out, &outlen);
iconv_close(cd);
string result(outbuf);
free(oufbuf);
return outbuf;
}
@ -225,10 +227,12 @@ string HKU_API gb_to_utf8(const string& szinput) {
memset(outbuf, 0, outlen);
char *in = inbuf;
char *out = outbuf;
iconv_t cd=iconv_open("utf-8","gb2312");
iconv_t cd=iconv_open("utf-8","gbk");
iconv(cd, &in, &inlen, &out, &outlen);
iconv_close(cd);
return outbuf;
string result(outbuf);
free(outbuf);
return result;
}
#endif /* defined(BOOST_WINDOWS) */

View File

@ -7,6 +7,8 @@
#include <boost/python.hpp>
#include <hikyuu/indicator/Indicator.h>
#include "../_Parameter.h"
#include "../pickle_support.h"
using namespace boost::python;
using namespace hku;

View File

@ -7,6 +7,7 @@
#include <boost/python.hpp>
#include <hikyuu/trade_sys/portfolio/build_in.h>
#include "../_Parameter.h"
#include "../pickle_support.h"
using namespace boost::python;

View File

@ -7,6 +7,7 @@
#include <boost/python.hpp>
#include <hikyuu/trade_sys/portfolio/build_in.h>
#include "../_Parameter.h"
#include "../pickle_support.h"
using namespace boost::python;

View File

@ -7,6 +7,7 @@
#include <boost/python.hpp>
#include <hikyuu/trade_sys/selector/build_in.h>
#include "../_Parameter.h"
#include "../pickle_support.h"
using namespace boost::python;

View File

@ -8,6 +8,8 @@
#include <boost/python.hpp>
#include <hikyuu/trade_sys/slippage/SlippageBase.h>
#include <hikyuu/trade_sys/slippage/build_in.h>
#include "../_Parameter.h"
#include "../pickle_support.h"
using namespace boost::python;
using namespace hku;

View File

@ -7,6 +7,7 @@
#include <boost/python.hpp>
#include <hikyuu/trade_sys/system/build_in.h>
#include "../_Parameter.h"
#include "../pickle_support.h"
using namespace boost::python;

View File

@ -547,7 +547,7 @@ std::string GBToUTF8(char *src_str) {
memset(buffer, 0, buffer_len);
buffer_len--;
iconv_t handle = iconv_open("utf-8", "gb2312");
iconv_t handle = iconv_open("utf-8", "gbk");
if (handle == (iconv_t) -1) {
perror("ICONV:");
return result;
@ -2384,10 +2384,10 @@ void tdx_import_stock_name_from_file(const SqlitePtr& db,
}
char buffer[315];
char stockname[9];
char stockname[10];
char stockcode[7];
memset(buffer, 0 , 315);
memset(stockname, 0, 9);
memset(stockname, 0, 10);
memset(stockcode, 0, 7);
file.read(buffer, 50);