Reading from and writing to the Windows console should be lossy #116871
Labels
A-io
Area: `std::io`, `std::fs`, `std::net` and `std::path`
O-windows
Operating system: Windows
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
The Windows console works with text whereas our
Read
andWrite
traits deal with arbitrary bytes. We currently use the Unicode Windows APIs and assume the bytes are in fact UTF-8. If they're not then we return an error. Similarly we expect that the input from the console will be actual Unicode text (I'd be surprised if it ever wasn't but I guess it's possible) and again we error if it's not. See here, here and here.Seeing as the console is a text interface, rather than a binary one, why not lossily replace any invalid Unicode to the replacement character?
The text was updated successfully, but these errors were encountered: