Humm, turns out there's still a problem, using print was covering up some
problems.
function get_key(key_::Ptr{Uint8}, key_length_::Ptr{Cint})
key_length = unsafe_load(key_length_)
key = bytestring(key_, key_length*4)
show(key)
println()
return key
end
Gives an output of
"T\0\0\0e\0\0\0s\0\0\0t\0\0\0
\0\0\0S\0\0\0t\0\0\0r\0\0\0i\0\0\0n\0\0\0g\0\0\0"
I can see where this is coming from due to the wide char being 32
characters instead of 8, eg. 4 times along, but i can't see a performant
(and this kind of needs to be) way of converting this to a sane string.
I need some kind of function to tell julia to look over 32 bits not 8 as at
creates the string, but I can't see how, I guess bytestring is doing what
it says on the tin and looking byte by byte.
I'm on 64 bit Ubuntu 14.03.