more unicode support, fix ffi wrappers