-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Open
Labels
Area-OutputRelated to output processing (inserting text into buffer, retrieving buffer text, etc.)Related to output processing (inserting text into buffer, retrieving buffer text, etc.)Area-ServerDown in the muck of API call servicing, interprocess communication, eventing, etc.Down in the muck of API call servicing, interprocess communication, eventing, etc.Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Product-ConhostFor issues in the Console codebaseFor issues in the Console codebase
Milestone
Description
Environment
Windows build number: [run "ver" at a command prompt]
Microsoft Windows [Version 10.0.18362.207]
Steps to reproduce
If a UTF-8 stream gets buffered in a loop, characters that consume more than one byte may get split at the buffer boundaries. Passing the buffer to WriteConsoleOutputCharacterA will corrupt the text because a conversion to UTF-16 is in place where these partials are treated as invalid UTF-8 characters and replaced with with U+FFFD characters.
Expected behavior
WriteConsoleOutputCharacterA should cache the partials and prepend them to the characters passed at the next call of this function, similar to the behavior of WriteConsoleA.
Actual behavior
UTF-8 partials result in corrupted text.
A discussion about this already began in #386 but was rather out of scope in this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-OutputRelated to output processing (inserting text into buffer, retrieving buffer text, etc.)Related to output processing (inserting text into buffer, retrieving buffer text, etc.)Area-ServerDown in the muck of API call servicing, interprocess communication, eventing, etc.Down in the muck of API call servicing, interprocess communication, eventing, etc.Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Product-ConhostFor issues in the Console codebaseFor issues in the Console codebase