File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ cdef void order_default_listener(int event_type,
243243 count = order[i].count,
244244 scope = order[i].scope,
245245 side = order[i].side,
246- exchange_code = unicode_from_dxf_const_string_t(& order[i].exchange_code),
246+ exchange_code = unicode_from_dxf_const_string_t(& order[i].exchange_code, size = 1 ),
247247 source = unicode_from_dxf_const_string_t(& order[i].source[0 ]),
248248 market_maker = unicode_from_dxf_const_string_t(order[i].market_maker),
249249 spread_symbol = unicode_from_dxf_const_string_t(order[i].spread_symbol))
Original file line number Diff line number Diff line change @@ -5,6 +5,6 @@ cdef extern from *:
55 PyObject * PyUnicode_FromWideChar(dxf_const_string_t w, Py_ssize_t size)
66 dxf_const_string_t PyUnicode_AsWideCharString(object , Py_ssize_t * )
77
8- cdef object unicode_from_dxf_const_string_t(dxf_const_string_t wcs)
8+ cdef object unicode_from_dxf_const_string_t(dxf_const_string_t wcs, int size = * )
99
1010cdef dxf_const_string_t dxf_const_string_t_from_unicode(object symbol)
Original file line number Diff line number Diff line change @@ -5,14 +5,16 @@ from dxfeed.core.pxd_include.DXTypes cimport *
55from pathlib import Path
66import dxfeed
77
8- cdef object unicode_from_dxf_const_string_t(dxf_const_string_t wcs):
8+ cdef object unicode_from_dxf_const_string_t(dxf_const_string_t wcs, int size = - 1 ):
99 """
1010 Cython function, callable from C to convert dxf_const_string_t(wchar_t) to unicode
1111
1212 Parameters
1313 ----------
1414 wcs: dxf_const_string_t, wchar_t
1515 C string
16+ size: int
17+ Number of characters. By default -1
1618
1719 Returns
1820 -------
@@ -21,7 +23,7 @@ cdef object unicode_from_dxf_const_string_t(dxf_const_string_t wcs):
2123 """
2224 if wcs == NULL :
2325 return ' '
24- ret_val = < object > PyUnicode_FromWideChar(wcs, - 1 )
26+ ret_val = < object > PyUnicode_FromWideChar(wcs, size )
2527 return ret_val
2628
2729cdef dxf_const_string_t dxf_const_string_t_from_unicode(object symbol):
You can’t perform that action at this time.
0 commit comments