【发布时间】:2019-01-23 20:51:14
【问题描述】:
以下 sn-p 代码(在从 quickfix.Application 派生的类中)以字符串形式检索 QuoteReqID 时 coredumps/SIGSEGV。我玩过 QuoteReqID 的大小,并注意到值
import quickfix as fix
...
def fromApp(self, message, session_id):
msg_type = fix.MsgType()
message.getHeader().getField(msg_type)
if msg_type.getString() is fix.MsgType_QuoteRequest:
quote_req_id_field = message.getField(fix.QuoteReqID())
quote_req_id = quote_req_id_field.getString()
print(quote_req_id)
我似乎无法复制 coredump 与 UnicodeEncodeError 所需的条件。当 UnicodeEncodeError 确实发生时,它在 FIX 日志中是这样的:
15 Characters
Original String=samplequotereqs
131=samplequotereqs
16 Characters
Original String=samplequotereqs
131= otereqs1
在第二个例子中,'otereqs1' 前面不是空格,而是一个白色清晰的垂直 unicode 块字符,我认为它是 U+25AF。
【问题讨论】:
标签: python python-3.6 swig python-unicode quickfix