Summary
Windows Registry paths are not generally guaranteed to be UTF-8. The paths are often used as inputs and outputs to other APIs, which take and return OS strings (OsStr or HSTRING, etc, which don't enforce encoding) requiring a _lossy or unwrap_or_default etc at the API boundary.
Crate manifest
Crate code