SIGN IN SIGN UP
rust-lang / rust UNCLAIMED

Empowering everyone to build reliable and efficient software.

0 0 69 Rust

Rollup merge of #127583 - Nilstrieb:invalid-utf8, r=joboet

Deal with invalid UTF-8 from `gai_strerror`

When the system is using a non-UTF-8 locale, the value will indeed not be UTF-8. That sucks for everyone involved, but is no reason for panic. We can "handle" this gracefully by just using from lossy, replacing the invalid UTF-8 with � and keeping the accidentally valid UTF-8. Good luck when debugging, but at least it's not a crash.

We already do this for `strerror_r`.

fixes #127563
J
Jubilee committed
6af66e836f0bcc497859dc37b397df89ddc69eac
Committed by GitHub <noreply@github.com> on 7/22/2024, 12:44:27 AM