pub(crate) fn ptr_to_string(x: *const i8) -> String
Converts a C string pointer to an owned Rust String.
String
Returns an empty string if the pointer is null. Uses lossy UTF-8 conversion to handle non-UTF-8 data gracefully.