Its not a Rust problem, any project that mixes using string with passing them to C FFI and operating system API will need to handle those somehow differently. In Rust this is expressed with types and necessary checks/conversions are verified by compiler. In other languages its developer responsibility to deal with the problem of (sometimes subtle) differences, there is nothing here to fix really.