I don't know; this is a very hard problem. Calling push! internally is a non-starter; it's very expensive, and ccall might not always have access to the array object itself. Maybe the UTF16String constructor can handle it?