-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: address windows lossy conversion inconsistency in
std
On Windows, `std` lossily converts an unpaired surrogate encoding into a single unicode replacement character, whereas on Unix, and also via `String`'s raw byte conversion, three unicode replacement characters are used. This comes from the fact that different code paths are used which take different approaches: `std::sys_common::wtf8::to_string_lossy` for Windows `OsStr` lossy conversion, vs. `core`'s `run_utf8_validation` function for Unix and for creaing a `String` from raw bytes. The inconsistency causes a problem in correct short option argument byte consumption tracking in our `OsStr` parsing code, due to using lossy `OsStr` conversion in combination with `std::str::from_utf8`. A [bug report][1] and [pull request][2] have been filed against `std`. [1]: rust-lang/rust#56786 [2]: rust-lang/rust#56787
- Loading branch information
Showing
2 changed files
with
112 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters