Use str::from_utf8_lossy() in os::args(), add os::args_as_bytes()
os::args() was using str::raw::from_c_str(), which would assert if the C-string wasn't valid UTF-8. Switch to using from_utf8_lossy() instead, and add a separate function os::args_as_bytes() that returns the ~[u8] byte-vectors instead.
Showing
想要评论请 注册 或 登录