Skip to content

Reading from and writing to the Windows console should be lossy #116871

@ChrisDenton

Description

@ChrisDenton

The Windows console works with text whereas our Read and Write 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`O-windowsOperating system: WindowsT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions