
Nov. 18, 2015
9:24 p.m.
We used ffi.string() to convert C++ char* to pypy string. But recently, we found out ffi.string() used '\0' as the indicator of string termination. And it bring some problems of converting a binary string. Our case is we read char*(buf) from a binary file, and buf might contain '\0'. Using ffi.string() we were not able to convert completed buf to PyPy string. We've tried ffi.string(buf, length), but it also did not work. Are there any solutions?