FFI - Creating a "&[u8]" from "const char*" Slice

you might want to look at my former discussion to get an idea what it involves not to do just EXIT and out as it is common practice
Proper UTF-8 Error Handling
The Example Use Case also shows why it is a real Requirement in Real World.