Ticket #359 (closed defect: fixed)
allow string -> unsigned char*
|Reported by:||robertwb||Owned by:||scoder|
On Jul 13, 2009, at 6:47 AM, Eric Eisner wrote: Hi, I was working on a wrapper for a c function that took an unsigned char* and its length (the string could have null bytes, so it needs a specific length). I was having some trouble getting cython to compile a simple conversion of string to unsigned char*, the way I eventually got it to work is: udata = <unsigned char*><char*>pydata This was a surprising requirement that took me a while to figure out. Is it intentional that strings cannot be directly cast to unsigned char?
Note: See TracTickets for help on using tickets.